/**
 * Copyright &copy; 2018
 * <a href="https://gitee.com/hackempire/patch-generator-desk">patch-generator-desk</a>
 * All rights reserved.
 */
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.empire.patch.generator.desk;

import com.empire.patch.generator.GeneratePatchExecutor;
import com.empire.patch.generator.desk.Enum.AnalysisTypeEnum;
import com.empire.patch.generator.desk.Enum.DependLevelEnum;
import com.empire.patch.generator.desk.utils.DOMUtils;
import com.empire.patch.generator.desk.utils.DateUtil;
import com.empire.patch.generator.desk.utils.FileUtil;
import com.empire.patch.generator.desk.utils.HttpUtil;
import com.empire.patch.generator.entity.PatchInfo;
import com.empire.patch.generator.entity.ProjectInfo;
import com.empire.patch.generator.entity.SourceMapper;
import com.empire.patch.generator.entity.SvnProjectInfo;
import com.empire.patch.generator.enums.GenTypeEnum;
import com.empire.patch.generator.enums.ProjectTypeEnum;
import com.empire.patch.generator.enums.VersionManagerTypeEnum;
import com.empire.patch.generator.desk.utils.MainFrameConsoleUtil;
import com.empire.patch.generator.desk.utils.StreamGobblerHandle;
import com.empire.patch.generator.entity.GitProjectInfo;
import com.empire.patch.generator.entity.ProjectReviseMapper;
import java.awt.Dimension;
import java.util.List;
import java.awt.Toolkit;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileOutputStream;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStreamWriter;
import java.io.Writer;
import java.net.URL;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.util.concurrent.BrokenBarrierException;
import java.util.concurrent.CyclicBarrier;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.Future;
import java.util.logging.Level;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JFileChooser;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JRadioButton;
import javax.swing.SwingUtilities;
import javax.swing.UIManager;
import javax.swing.filechooser.FileFilter;
import javax.swing.table.DefaultTableModel;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang.StringUtils;
import org.dom4j.Document;
import org.dom4j.DocumentHelper;
import org.dom4j.Element;
import org.dom4j.io.OutputFormat;
import org.dom4j.io.XMLWriter;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * 桌面增量打包神器主代码
 *
 * @author Aaron
 */
public class GeneratorMainJFrame extends javax.swing.JFrame {

    /**
     * Creates new form GeneratorMainJFrame
     */
    public GeneratorMainJFrame() {
        initComponents();
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        SVNLOGPROJECTTYPEbuttonGroup = new javax.swing.ButtonGroup();
        GITLOGPROJECTTYPEbuttonGroup = new javax.swing.ButtonGroup();
        GITSERVERPROJECTTYPEbuttonGroup = new javax.swing.ButtonGroup();
        SVNSERVERPROJECTTYPEbuttonGroup = new javax.swing.ButtonGroup();
        MVNPOMANALYSISbuttonGroup = new javax.swing.ButtonGroup();
        MVNPOMDEPENDLEVELbuttonGroup = new javax.swing.ButtonGroup();
        PatchjTabbedPane = new javax.swing.JTabbedPane();
        GITSERVERjScrollPane = new javax.swing.JScrollPane();
        GITSERVERjPanel = new javax.swing.JPanel();
        GITSERVERPROJECTNAMEjLabel = new javax.swing.JLabel();
        GITSERVERPROJECTNAMEjTextField = new javax.swing.JTextField();
        GITSERVERPROJECTjLabel = new javax.swing.JLabel();
        GITSERVERPROJECTPATHjTextField = new javax.swing.JTextField();
        GITSERVERPROJECTjButton = new javax.swing.JButton();
        GITSERVERPATHjLabel = new javax.swing.JLabel();
        GITSERVERPATHjTextField = new javax.swing.JTextField();
        GITSERVERPATHjButton = new javax.swing.JButton();
        GITSERVEROUTPUTjLabel = new javax.swing.JLabel();
        GITSERVEROUTPUTjTextField = new javax.swing.JTextField();
        GITSERVEROUTPUTjButton = new javax.swing.JButton();
        GITSERVERPROJECTTYPEjLabel = new javax.swing.JLabel();
        GITSERVERPROJECTSINGLEjRadioButton = new javax.swing.JRadioButton();
        GITSERVERPROJECTMUTILjRadioButton = new javax.swing.JRadioButton();
        GITSERVERTABELjScrollPane = new javax.swing.JScrollPane();
        GITSERVERSOURCEMAPPERjTable = new javax.swing.JTable();
        GITSERVERADDjButton = new javax.swing.JButton();
        GITSERVERDELjButton = new javax.swing.JButton();
        GITSERVERSAVECONFIGjButton = new javax.swing.JButton();
        GITSERVEROUTPACKjButton = new javax.swing.JButton();
        GITSERVERVERSIONjLabel = new javax.swing.JLabel();
        GITSERVERVERSIONENDjTextField = new javax.swing.JTextField();
        GITSERVERVERSIONSTARTjTextField = new javax.swing.JTextField();
        GITSERVERVERSIONCENTERjLabel = new javax.swing.JLabel();
        GITSERVERPROJECTCONFIGjButton = new javax.swing.JButton();
        SVNSERVERjScrollPane = new javax.swing.JScrollPane();
        SVNSERVERjPanel = new javax.swing.JPanel();
        SVNSERVERPROJECTNAMEjLabel = new javax.swing.JLabel();
        SVNSERVERPROJECTNAMEjTextField = new javax.swing.JTextField();
        SVNSERVERPROJECTjLabel = new javax.swing.JLabel();
        SVNSERVERPROJECTPATHjTextField = new javax.swing.JTextField();
        SVNSERVERPATHjLabel = new javax.swing.JLabel();
        SVNSERVERPATHjTextField = new javax.swing.JTextField();
        SVNSERVEROUTPUTjLabel = new javax.swing.JLabel();
        SVNSERVEROUTPUTjTextField = new javax.swing.JTextField();
        SVNSERVERPROJECTjButton = new javax.swing.JButton();
        SVNSERVEROUTPUTjButton = new javax.swing.JButton();
        SVNSERVERPROJECTTYPEjLabel = new javax.swing.JLabel();
        SVNSERVERPROJECTSINGLEjRadioButton = new javax.swing.JRadioButton();
        SVNSERVERPROJECTMUTILjRadioButton = new javax.swing.JRadioButton();
        SVNSERVERVERSIONjLabel = new javax.swing.JLabel();
        SVNSERVERVERSIONSTARTjTextField = new javax.swing.JTextField();
        SVNSERVERTABELjScrollPane = new javax.swing.JScrollPane();
        SVNSERVERSOURCEMAPPERjTable = new javax.swing.JTable();
        SVNSERVERADDjButton = new javax.swing.JButton();
        SVNSERVERDELjButton = new javax.swing.JButton();
        SVNSERVERSAVECONFIGjButton = new javax.swing.JButton();
        SVNSERVEROUTPACKjButton = new javax.swing.JButton();
        SVNSERVEREXCLUDEjLabel = new javax.swing.JLabel();
        SVNSERVERVERSIONCENTERjLabel = new javax.swing.JLabel();
        SVNSERVERVERSIONENDjTextField = new javax.swing.JTextField();
        SVNSERVERACOUNTjLabel = new javax.swing.JLabel();
        SVNSERVERPWDjLabel = new javax.swing.JLabel();
        SVNSERVERREVISEjTextField = new javax.swing.JTextField();
        SVNSERVERACOUNTjTextField = new javax.swing.JTextField();
        SVNSERVERREVISEPATHjLabel = new javax.swing.JLabel();
        SVNSERVEREXCLUDEjTextField = new javax.swing.JTextField();
        SVNSERVERPROJECTCONFIGjButton = new javax.swing.JButton();
        SVNSERVERPWDjPasswordField = new javax.swing.JPasswordField();
        GITLOGjScrollPane = new javax.swing.JScrollPane();
        GITLOGjPanel = new javax.swing.JPanel();
        GITLOGPROJECTNAMEjLabel = new javax.swing.JLabel();
        GITLOGPROJECTNAMEjTextField = new javax.swing.JTextField();
        GITLOGPROJECTjLabel = new javax.swing.JLabel();
        GITLOGPROJECTPATHjTextField = new javax.swing.JTextField();
        GITLOGPROJECTjButton = new javax.swing.JButton();
        GITLOGPATHjLabel = new javax.swing.JLabel();
        GITLOGPATHjTextField = new javax.swing.JTextField();
        GITLOGPATHjButton = new javax.swing.JButton();
        GITLOGOUTPUTjLabel = new javax.swing.JLabel();
        GITLOGOUTPUTjTextField = new javax.swing.JTextField();
        GITLOGOUTPUTjButton = new javax.swing.JButton();
        GITLOGPROJECTTYPEjLabel = new javax.swing.JLabel();
        GITLOGPROJECTSINGLEjRadioButton = new javax.swing.JRadioButton();
        GITLOGPROJECTMUTILjRadioButton = new javax.swing.JRadioButton();
        GITLOGTABELjScrollPane = new javax.swing.JScrollPane();
        GITLOGSOURCEMAPPERjTable = new javax.swing.JTable();
        GITLOGADDjButton = new javax.swing.JButton();
        GITLOGDELjButton = new javax.swing.JButton();
        GITLOGSAVECONFIGjButton = new javax.swing.JButton();
        GITLOGOUTPACKjButton = new javax.swing.JButton();
        GITLOGPROJECTCONFIGjButton = new javax.swing.JButton();
        SVNLOGjScrollPane = new javax.swing.JScrollPane();
        SVNLOGjPanel = new javax.swing.JPanel();
        SVNLOGPATHjLabel = new javax.swing.JLabel();
        SVNLOGPATHjTextField = new javax.swing.JTextField();
        SVNLOGPROJECTjLabel = new javax.swing.JLabel();
        SVNLOGPROJECTPATHjTextField = new javax.swing.JTextField();
        SVNLOGPROJECTNAMEjLabel = new javax.swing.JLabel();
        SVNLOGPROJECTNAMEjTextField = new javax.swing.JTextField();
        SVNLOGOUTPUTjLabel = new javax.swing.JLabel();
        SVNLOGOUTPUTjTextField = new javax.swing.JTextField();
        SVNLOGPROJECTjButton = new javax.swing.JButton();
        SVNLOGPATHjButton = new javax.swing.JButton();
        SVNLOGOUTPUTjButton = new javax.swing.JButton();
        SVNLOGOUTPACKjButton = new javax.swing.JButton();
        SVNLOGTABELjScrollPane = new javax.swing.JScrollPane();
        SVNLOGSOURCEMAPPERjTable = new javax.swing.JTable();
        SVNLOGADDjButton = new javax.swing.JButton();
        SVNLOGDELjButton = new javax.swing.JButton();
        SVNLOGPROJECTSINGLEjRadioButton = new javax.swing.JRadioButton();
        SVNLOGPROJECTTYPEjLabel = new javax.swing.JLabel();
        SVNLOGPROJECTMUTILjRadioButton = new javax.swing.JRadioButton();
        SVNLOGSAVECONFIGjButton = new javax.swing.JButton();
        SVNLOGPROJECTCONFIGjButton = new javax.swing.JButton();
        MVNjScrollPane = new javax.swing.JScrollPane();
        MVNPOMANALYSISjPanel = new javax.swing.JPanel();
        MVNPOMNEWPATHjLabel = new javax.swing.JLabel();
        MVNPOMNEWPATHjTextField = new javax.swing.JTextField();
        MVNPOMANALYSISNAMEPROJECTNAMEjLabel = new javax.swing.JLabel();
        MVNPOMANALYSISNAMEPROJECTNAMEjTextField = new javax.swing.JTextField();
        MVNPOMANALYSISOUTPUTjLabel = new javax.swing.JLabel();
        MVNPOMANALYSISOUTPUTjTextField = new javax.swing.JTextField();
        MVNPOMOLDPATHjButton = new javax.swing.JButton();
        MVNPOMANALYSISOUTPUTjButton = new javax.swing.JButton();
        MVNPOMANALYSISOUTPACKjButton = new javax.swing.JButton();
        MVNPOMCOMPLETEANALYSISjRadioButton = new javax.swing.JRadioButton();
        MVNPOMDEPENDLEVELjLabel = new javax.swing.JLabel();
        MVNPOMDIFFANALYSISjRadioButton = new javax.swing.JRadioButton();
        MVNPOMANALYSISCONFIGjButton = new javax.swing.JButton();
        MVNPOMANALYSISCTCONFIGjButton = new javax.swing.JButton();
        MVNPOMANALYSISNAMEjTextField = new javax.swing.JTextField();
        MVNPOMANALYSISNAMEjLabel = new javax.swing.JLabel();
        MVNPOMOLDPATHjLabel = new javax.swing.JLabel();
        MVNPOMOLDPATHjTextField = new javax.swing.JTextField();
        MVNPOMNEWPATHjButton = new javax.swing.JButton();
        MVNPOMANALYSISTYPEjLabel1 = new javax.swing.JLabel();
        MVNPOMTESTjRadioButton = new javax.swing.JRadioButton();
        MVNPOMSYSTEMjRadioButton = new javax.swing.JRadioButton();
        MVNPOMCOMPILEjRadioButton = new javax.swing.JRadioButton();
        MVNPOMRUNTIMEjRadioButton = new javax.swing.JRadioButton();
        MVNPOMPROVIDEDjRadioButton = new javax.swing.JRadioButton();
        CONSOLEtextArea = new java.awt.TextArea();
        CONSOLEjLabel = new javax.swing.JLabel();
        globalConsolejScrollPane = new javax.swing.JScrollPane();
        globalConsolejTextPane = new javax.swing.JTextPane();
        globalConsoleClearjButton = new javax.swing.JButton();
        PROJECTADDRESSjLabel = new javax.swing.JLabel();
        SOFTVERSIONjLabel = new javax.swing.JLabel();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle("Empire全自动打包神器v3.5.0_Creat By Aaron【Q群456742016】");
        setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
        setIconImage(Toolkit.getDefaultToolkit().getImage("favicon-20180430115456304.ico"));
        setLocation(new java.awt.Point(0, 0));
        setName("mainframe"); // NOI18N
        setResizable(false);
        setSize(new java.awt.Dimension(300, 200));
        getContentPane().setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

        GITSERVERjScrollPane.setPreferredSize(new java.awt.Dimension(0, 0));

        GITSERVERjPanel.setPreferredSize(new java.awt.Dimension(0, 0));
        GITSERVERjPanel.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

        GITSERVERPROJECTNAMEjLabel.setText("项目名称");
        GITSERVERjPanel.add(GITSERVERPROJECTNAMEjLabel, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 20, 50, 20));

        GITSERVERPROJECTNAMEjTextField.setFont(new java.awt.Font("幼圆", 0, 10)); // NOI18N
        GITSERVERjPanel.add(GITSERVERPROJECTNAMEjTextField, new org.netbeans.lib.awtextra.AbsoluteConstraints(110, 20, 420, 20));

        GITSERVERPROJECTjLabel.setText("项目路径");
        GITSERVERjPanel.add(GITSERVERPROJECTjLabel, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 50, -1, 20));

        GITSERVERPROJECTPATHjTextField.setFont(new java.awt.Font("幼圆", 0, 10)); // NOI18N
        GITSERVERjPanel.add(GITSERVERPROJECTPATHjTextField, new org.netbeans.lib.awtextra.AbsoluteConstraints(110, 50, 420, 20));

        GITSERVERPROJECTjButton.setText("浏览");
        GITSERVERPROJECTjButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                GITSERVERPROJECTjButtonActionPerformed(evt);
            }
        });
        GITSERVERjPanel.add(GITSERVERPROJECTjButton, new org.netbeans.lib.awtextra.AbsoluteConstraints(540, 50, -1, 20));

        GITSERVERPATHjLabel.setText("GIT本地URL路径");
        GITSERVERjPanel.add(GITSERVERPATHjLabel, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 81, 90, 20));

        GITSERVERPATHjTextField.setFont(new java.awt.Font("幼圆", 0, 10)); // NOI18N
        GITSERVERjPanel.add(GITSERVERPATHjTextField, new org.netbeans.lib.awtextra.AbsoluteConstraints(110, 80, 420, 20));

        GITSERVERPATHjButton.setText("浏览");
        GITSERVERPATHjButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                GITSERVERPATHjButtonActionPerformed(evt);
            }
        });
        GITSERVERjPanel.add(GITSERVERPATHjButton, new org.netbeans.lib.awtextra.AbsoluteConstraints(540, 80, -1, 20));

        GITSERVEROUTPUTjLabel.setText("输出目录");
        GITSERVERjPanel.add(GITSERVEROUTPUTjLabel, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 110, 50, 23));

        GITSERVEROUTPUTjTextField.setFont(new java.awt.Font("幼圆", 0, 10)); // NOI18N
        GITSERVERjPanel.add(GITSERVEROUTPUTjTextField, new org.netbeans.lib.awtextra.AbsoluteConstraints(110, 110, 420, 20));

        GITSERVEROUTPUTjButton.setText("浏览");
        GITSERVEROUTPUTjButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                GITSERVEROUTPUTjButtonActionPerformed(evt);
            }
        });
        GITSERVERjPanel.add(GITSERVEROUTPUTjButton, new org.netbeans.lib.awtextra.AbsoluteConstraints(540, 110, -1, 20));

        GITSERVERPROJECTTYPEjLabel.setText("项目类型");
        GITSERVERjPanel.add(GITSERVERPROJECTTYPEjLabel, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 140, -1, 20));

        GITSERVERPROJECTTYPEbuttonGroup.add(GITSERVERPROJECTSINGLEjRadioButton);
        GITSERVERPROJECTSINGLEjRadioButton.setSelected(true);
        GITSERVERPROJECTSINGLEjRadioButton.setText("单模块");
        GITSERVERjPanel.add(GITSERVERPROJECTSINGLEjRadioButton, new org.netbeans.lib.awtextra.AbsoluteConstraints(110, 140, -1, -1));

        GITSERVERPROJECTTYPEbuttonGroup.add(GITSERVERPROJECTMUTILjRadioButton);
        GITSERVERPROJECTMUTILjRadioButton.setText("多模块");
        GITSERVERjPanel.add(GITSERVERPROJECTMUTILjRadioButton, new org.netbeans.lib.awtextra.AbsoluteConstraints(190, 140, -1, -1));

        GITSERVERTABELjScrollPane.setAutoscrolls(true);

        GITSERVERSOURCEMAPPERjTable.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {"/src/main/java", "target/classes", "/WEB-INF/classes"},
                {"/src/main/resources", "target/classes", "/WEB-INF/classes"},
                {"/src/main/webapp", "src/main/webapp", null}
            },
            new String [] {
                "sourceDir", "targetDir", "patchDir"
            }
        ) {
            Class[] types = new Class [] {
                java.lang.String.class, java.lang.String.class, java.lang.String.class
            };

            public Class getColumnClass(int columnIndex) {
                return types [columnIndex];
            }
        });
        GITSERVERSOURCEMAPPERjTable.setDragEnabled(true);
        GITSERVERSOURCEMAPPERjTable.setSelectionBackground(new java.awt.Color(204, 255, 204));
        GITSERVERSOURCEMAPPERjTable.setSelectionForeground(new java.awt.Color(0, 0, 0));
        GITSERVERTABELjScrollPane.setViewportView(GITSERVERSOURCEMAPPERjTable);

        GITSERVERjPanel.add(GITSERVERTABELjScrollPane, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 200, 530, 110));

        GITSERVERADDjButton.setText("新增");
        GITSERVERADDjButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                GITSERVERADDjButtonActionPerformed(evt);
            }
        });
        GITSERVERjPanel.add(GITSERVERADDjButton, new org.netbeans.lib.awtextra.AbsoluteConstraints(540, 200, -1, 20));

        GITSERVERDELjButton.setText("删除");
        GITSERVERDELjButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                GITSERVERDELjButtonActionPerformed(evt);
            }
        });
        GITSERVERjPanel.add(GITSERVERDELjButton, new org.netbeans.lib.awtextra.AbsoluteConstraints(540, 230, -1, 20));

        GITSERVERSAVECONFIGjButton.setText("保存");
        GITSERVERSAVECONFIGjButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                GITSERVERSAVECONFIGjButtonActionPerformed(evt);
            }
        });
        GITSERVERjPanel.add(GITSERVERSAVECONFIGjButton, new org.netbeans.lib.awtextra.AbsoluteConstraints(540, 260, -1, 20));

        GITSERVEROUTPACKjButton.setText("打包");
        GITSERVEROUTPACKjButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                GITSERVEROUTPACKjButtonActionPerformed(evt);
            }
        });
        GITSERVERjPanel.add(GITSERVEROUTPACKjButton, new org.netbeans.lib.awtextra.AbsoluteConstraints(540, 290, -1, 20));

        GITSERVERVERSIONjLabel.setText("GIT版本范围");
        GITSERVERjPanel.add(GITSERVERVERSIONjLabel, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 170, -1, 20));

        GITSERVERVERSIONENDjTextField.setFont(new java.awt.Font("幼圆", 0, 10)); // NOI18N
        GITSERVERjPanel.add(GITSERVERVERSIONENDjTextField, new org.netbeans.lib.awtextra.AbsoluteConstraints(220, 170, 90, 20));

        GITSERVERVERSIONSTARTjTextField.setFont(new java.awt.Font("幼圆", 0, 10)); // NOI18N
        GITSERVERjPanel.add(GITSERVERVERSIONSTARTjTextField, new org.netbeans.lib.awtextra.AbsoluteConstraints(110, 170, 90, 20));

        GITSERVERVERSIONCENTERjLabel.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        GITSERVERVERSIONCENTERjLabel.setText("至");
        GITSERVERVERSIONCENTERjLabel.setAutoscrolls(true);
        GITSERVERVERSIONCENTERjLabel.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        GITSERVERjPanel.add(GITSERVERVERSIONCENTERjLabel, new org.netbeans.lib.awtextra.AbsoluteConstraints(200, 170, 20, 20));

        GITSERVERPROJECTCONFIGjButton.setText("配置");
        GITSERVERPROJECTCONFIGjButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                GITSERVERPROJECTCONFIGjButtonActionPerformed(evt);
            }
        });
        GITSERVERjPanel.add(GITSERVERPROJECTCONFIGjButton, new org.netbeans.lib.awtextra.AbsoluteConstraints(540, 20, -1, 20));

        GITSERVERjScrollPane.setViewportView(GITSERVERjPanel);

        PatchjTabbedPane.addTab("GIT服务器增量", GITSERVERjScrollPane);

        SVNSERVERjScrollPane.setPreferredSize(new java.awt.Dimension(0, 0));

        SVNSERVERjPanel.setPreferredSize(new java.awt.Dimension(0, 0));
        SVNSERVERjPanel.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

        SVNSERVERPROJECTNAMEjLabel.setText("项目名称");
        SVNSERVERjPanel.add(SVNSERVERPROJECTNAMEjLabel, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 20, 50, 20));

        SVNSERVERPROJECTNAMEjTextField.setFont(new java.awt.Font("幼圆", 0, 10)); // NOI18N
        SVNSERVERjPanel.add(SVNSERVERPROJECTNAMEjTextField, new org.netbeans.lib.awtextra.AbsoluteConstraints(110, 20, 420, 20));

        SVNSERVERPROJECTjLabel.setText("项目路径");
        SVNSERVERjPanel.add(SVNSERVERPROJECTjLabel, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 50, -1, 20));

        SVNSERVERPROJECTPATHjTextField.setFont(new java.awt.Font("幼圆", 0, 10)); // NOI18N
        SVNSERVERjPanel.add(SVNSERVERPROJECTPATHjTextField, new org.netbeans.lib.awtextra.AbsoluteConstraints(110, 50, 420, 20));

        SVNSERVERPATHjLabel.setText("SVNURL路径");
        SVNSERVERjPanel.add(SVNSERVERPATHjLabel, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 81, 90, 20));

        SVNSERVERPATHjTextField.setFont(new java.awt.Font("幼圆", 0, 10)); // NOI18N
        SVNSERVERjPanel.add(SVNSERVERPATHjTextField, new org.netbeans.lib.awtextra.AbsoluteConstraints(110, 80, 420, 20));

        SVNSERVEROUTPUTjLabel.setText("输出目录");
        SVNSERVERjPanel.add(SVNSERVEROUTPUTjLabel, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 110, 50, 23));

        SVNSERVEROUTPUTjTextField.setFont(new java.awt.Font("幼圆", 0, 10)); // NOI18N
        SVNSERVERjPanel.add(SVNSERVEROUTPUTjTextField, new org.netbeans.lib.awtextra.AbsoluteConstraints(110, 110, 420, 20));

        SVNSERVERPROJECTjButton.setText("浏览");
        SVNSERVERPROJECTjButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                SVNSERVERPROJECTjButtonActionPerformed(evt);
            }
        });
        SVNSERVERjPanel.add(SVNSERVERPROJECTjButton, new org.netbeans.lib.awtextra.AbsoluteConstraints(540, 50, -1, 20));

        SVNSERVEROUTPUTjButton.setText("浏览");
        SVNSERVEROUTPUTjButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                SVNSERVEROUTPUTjButtonActionPerformed(evt);
            }
        });
        SVNSERVERjPanel.add(SVNSERVEROUTPUTjButton, new org.netbeans.lib.awtextra.AbsoluteConstraints(540, 110, -1, 20));

        SVNSERVERPROJECTTYPEjLabel.setText("项目类型");
        SVNSERVERjPanel.add(SVNSERVERPROJECTTYPEjLabel, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 140, -1, 20));

        SVNSERVERPROJECTTYPEbuttonGroup.add(SVNSERVERPROJECTSINGLEjRadioButton);
        SVNSERVERPROJECTSINGLEjRadioButton.setSelected(true);
        SVNSERVERPROJECTSINGLEjRadioButton.setText("单模块");
        SVNSERVERjPanel.add(SVNSERVERPROJECTSINGLEjRadioButton, new org.netbeans.lib.awtextra.AbsoluteConstraints(110, 140, -1, -1));

        SVNSERVERPROJECTTYPEbuttonGroup.add(SVNSERVERPROJECTMUTILjRadioButton);
        SVNSERVERPROJECTMUTILjRadioButton.setText("多模块");
        SVNSERVERjPanel.add(SVNSERVERPROJECTMUTILjRadioButton, new org.netbeans.lib.awtextra.AbsoluteConstraints(190, 140, -1, -1));

        SVNSERVERVERSIONjLabel.setText("SVN版本范围");
        SVNSERVERjPanel.add(SVNSERVERVERSIONjLabel, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 170, -1, 20));

        SVNSERVERVERSIONSTARTjTextField.setFont(new java.awt.Font("幼圆", 0, 10)); // NOI18N
        SVNSERVERjPanel.add(SVNSERVERVERSIONSTARTjTextField, new org.netbeans.lib.awtextra.AbsoluteConstraints(110, 170, 90, 20));

        SVNSERVERTABELjScrollPane.setAutoscrolls(true);

        SVNSERVERSOURCEMAPPERjTable.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {"/src/main/java", "target/classes", "/WEB-INF/classes"},
                {"/src/main/resources", "target/classes", "/WEB-INF/classes"},
                {"/src/main/webapp", "src/main/webapp", null}
            },
            new String [] {
                "sourceDir", "targetDir", "patchDir"
            }
        ) {
            Class[] types = new Class [] {
                java.lang.String.class, java.lang.String.class, java.lang.String.class
            };

            public Class getColumnClass(int columnIndex) {
                return types [columnIndex];
            }
        });
        SVNSERVERSOURCEMAPPERjTable.setDragEnabled(true);
        SVNSERVERSOURCEMAPPERjTable.setSelectionBackground(new java.awt.Color(204, 255, 204));
        SVNSERVERSOURCEMAPPERjTable.setSelectionForeground(new java.awt.Color(0, 0, 0));
        SVNSERVERSOURCEMAPPERjTable.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                SVNSERVERSOURCEMAPPERjTableMouseClicked(evt);
            }
        });
        SVNSERVERTABELjScrollPane.setViewportView(SVNSERVERSOURCEMAPPERjTable);

        SVNSERVERjPanel.add(SVNSERVERTABELjScrollPane, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 230, 530, 110));

        SVNSERVERADDjButton.setText("新增");
        SVNSERVERADDjButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                SVNSERVERADDjButtonActionPerformed(evt);
            }
        });
        SVNSERVERjPanel.add(SVNSERVERADDjButton, new org.netbeans.lib.awtextra.AbsoluteConstraints(540, 230, -1, 20));

        SVNSERVERDELjButton.setText("删除");
        SVNSERVERDELjButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                SVNSERVERDELjButtonActionPerformed(evt);
            }
        });
        SVNSERVERjPanel.add(SVNSERVERDELjButton, new org.netbeans.lib.awtextra.AbsoluteConstraints(540, 260, -1, 20));

        SVNSERVERSAVECONFIGjButton.setText("保存");
        SVNSERVERSAVECONFIGjButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                SVNSERVERSAVECONFIGjButtonActionPerformed(evt);
            }
        });
        SVNSERVERjPanel.add(SVNSERVERSAVECONFIGjButton, new org.netbeans.lib.awtextra.AbsoluteConstraints(540, 290, -1, 20));

        SVNSERVEROUTPACKjButton.setText("打包");
        SVNSERVEROUTPACKjButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                SVNSERVEROUTPACKjButtonActionPerformed(evt);
            }
        });
        SVNSERVERjPanel.add(SVNSERVEROUTPACKjButton, new org.netbeans.lib.awtextra.AbsoluteConstraints(540, 320, -1, 20));

        SVNSERVEREXCLUDEjLabel.setText("排除版本");
        SVNSERVERjPanel.add(SVNSERVEREXCLUDEjLabel, new org.netbeans.lib.awtextra.AbsoluteConstraints(340, 170, -1, 20));

        SVNSERVERVERSIONCENTERjLabel.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        SVNSERVERVERSIONCENTERjLabel.setText("至");
        SVNSERVERVERSIONCENTERjLabel.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        SVNSERVERjPanel.add(SVNSERVERVERSIONCENTERjLabel, new org.netbeans.lib.awtextra.AbsoluteConstraints(200, 170, 20, 20));

        SVNSERVERVERSIONENDjTextField.setFont(new java.awt.Font("幼圆", 0, 10)); // NOI18N
        SVNSERVERjPanel.add(SVNSERVERVERSIONENDjTextField, new org.netbeans.lib.awtextra.AbsoluteConstraints(220, 170, 90, 20));

        SVNSERVERACOUNTjLabel.setText("SVN账户");
        SVNSERVERjPanel.add(SVNSERVERACOUNTjLabel, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 200, -1, -1));

        SVNSERVERPWDjLabel.setText("密码");
        SVNSERVERjPanel.add(SVNSERVERPWDjLabel, new org.netbeans.lib.awtextra.AbsoluteConstraints(340, 200, -1, -1));

        SVNSERVERREVISEjTextField.setFont(new java.awt.Font("幼圆", 0, 10)); // NOI18N
        SVNSERVERREVISEjTextField.setToolTipText("");
        SVNSERVERREVISEjTextField.setName(""); // NOI18N
        SVNSERVERjPanel.add(SVNSERVERREVISEjTextField, new org.netbeans.lib.awtextra.AbsoluteConstraints(390, 140, 140, 20));

        SVNSERVERACOUNTjTextField.setFont(new java.awt.Font("幼圆", 0, 10)); // NOI18N
        SVNSERVERjPanel.add(SVNSERVERACOUNTjTextField, new org.netbeans.lib.awtextra.AbsoluteConstraints(110, 200, 200, 20));

        SVNSERVERREVISEPATHjLabel.setText("修正路径");
        SVNSERVERjPanel.add(SVNSERVERREVISEPATHjLabel, new org.netbeans.lib.awtextra.AbsoluteConstraints(340, 140, -1, 20));

        SVNSERVEREXCLUDEjTextField.setFont(new java.awt.Font("幼圆", 0, 10)); // NOI18N
        SVNSERVERjPanel.add(SVNSERVEREXCLUDEjTextField, new org.netbeans.lib.awtextra.AbsoluteConstraints(390, 170, 140, 20));

        SVNSERVERPROJECTCONFIGjButton.setText("配置");
        SVNSERVERPROJECTCONFIGjButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                SVNSERVERPROJECTCONFIGjButtonActionPerformed(evt);
            }
        });
        SVNSERVERjPanel.add(SVNSERVERPROJECTCONFIGjButton, new org.netbeans.lib.awtextra.AbsoluteConstraints(540, 20, -1, 20));
        SVNSERVERjPanel.add(SVNSERVERPWDjPasswordField, new org.netbeans.lib.awtextra.AbsoluteConstraints(390, 200, 140, 20));

        SVNSERVERjScrollPane.setViewportView(SVNSERVERjPanel);

        PatchjTabbedPane.addTab("SVN服务器增量", SVNSERVERjScrollPane);

        GITLOGjScrollPane.setPreferredSize(new java.awt.Dimension(0, 0));

        GITLOGjPanel.setPreferredSize(new java.awt.Dimension(0, 0));
        GITLOGjPanel.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

        GITLOGPROJECTNAMEjLabel.setText("项目名称");
        GITLOGjPanel.add(GITLOGPROJECTNAMEjLabel, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 20, 50, 20));

        GITLOGPROJECTNAMEjTextField.setFont(new java.awt.Font("幼圆", 0, 10)); // NOI18N
        GITLOGjPanel.add(GITLOGPROJECTNAMEjTextField, new org.netbeans.lib.awtextra.AbsoluteConstraints(110, 20, 420, 20));

        GITLOGPROJECTjLabel.setText("项目路径");
        GITLOGjPanel.add(GITLOGPROJECTjLabel, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 50, -1, 20));

        GITLOGPROJECTPATHjTextField.setFont(new java.awt.Font("幼圆", 0, 10)); // NOI18N
        GITLOGjPanel.add(GITLOGPROJECTPATHjTextField, new org.netbeans.lib.awtextra.AbsoluteConstraints(110, 50, 420, 20));

        GITLOGPROJECTjButton.setText("浏览");
        GITLOGPROJECTjButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                GITLOGPROJECTjButtonActionPerformed(evt);
            }
        });
        GITLOGjPanel.add(GITLOGPROJECTjButton, new org.netbeans.lib.awtextra.AbsoluteConstraints(540, 50, -1, 20));

        GITLOGPATHjLabel.setText("GIT日志路径");
        GITLOGjPanel.add(GITLOGPATHjLabel, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 81, 90, 20));

        GITLOGPATHjTextField.setFont(new java.awt.Font("幼圆", 0, 10)); // NOI18N
        GITLOGjPanel.add(GITLOGPATHjTextField, new org.netbeans.lib.awtextra.AbsoluteConstraints(110, 80, 420, 20));

        GITLOGPATHjButton.setText("浏览");
        GITLOGPATHjButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                GITLOGPATHjButtonActionPerformed(evt);
            }
        });
        GITLOGjPanel.add(GITLOGPATHjButton, new org.netbeans.lib.awtextra.AbsoluteConstraints(540, 80, -1, 20));

        GITLOGOUTPUTjLabel.setText("输出目录");
        GITLOGjPanel.add(GITLOGOUTPUTjLabel, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 110, 50, 23));

        GITLOGOUTPUTjTextField.setFont(new java.awt.Font("幼圆", 0, 10)); // NOI18N
        GITLOGjPanel.add(GITLOGOUTPUTjTextField, new org.netbeans.lib.awtextra.AbsoluteConstraints(110, 110, 420, 20));

        GITLOGOUTPUTjButton.setText("浏览");
        GITLOGOUTPUTjButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                GITLOGOUTPUTjButtonActionPerformed(evt);
            }
        });
        GITLOGjPanel.add(GITLOGOUTPUTjButton, new org.netbeans.lib.awtextra.AbsoluteConstraints(540, 110, -1, 20));

        GITLOGPROJECTTYPEjLabel.setText("项目类型");
        GITLOGjPanel.add(GITLOGPROJECTTYPEjLabel, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 140, -1, 20));

        GITLOGPROJECTTYPEbuttonGroup.add(GITLOGPROJECTSINGLEjRadioButton);
        GITLOGPROJECTSINGLEjRadioButton.setSelected(true);
        GITLOGPROJECTSINGLEjRadioButton.setText("单模块");
        GITLOGjPanel.add(GITLOGPROJECTSINGLEjRadioButton, new org.netbeans.lib.awtextra.AbsoluteConstraints(110, 140, -1, -1));

        GITLOGPROJECTTYPEbuttonGroup.add(GITLOGPROJECTMUTILjRadioButton);
        GITLOGPROJECTMUTILjRadioButton.setText("多模块");
        GITLOGjPanel.add(GITLOGPROJECTMUTILjRadioButton, new org.netbeans.lib.awtextra.AbsoluteConstraints(190, 140, -1, -1));

        GITLOGTABELjScrollPane.setAutoscrolls(true);

        GITLOGSOURCEMAPPERjTable.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {"/src/main/java", "target/classes", "/WEB-INF/classes"},
                {"/src/main/resources", "target/classes", "/WEB-INF/classes"},
                {"/src/main/webapp", "src/main/webapp", null}
            },
            new String [] {
                "sourceDir", "targetDir", "patchDir"
            }
        ) {
            Class[] types = new Class [] {
                java.lang.String.class, java.lang.String.class, java.lang.String.class
            };

            public Class getColumnClass(int columnIndex) {
                return types [columnIndex];
            }
        });
        GITLOGSOURCEMAPPERjTable.setDoubleBuffered(true);
        GITLOGSOURCEMAPPERjTable.setSelectionBackground(new java.awt.Color(204, 255, 204));
        GITLOGSOURCEMAPPERjTable.setSelectionForeground(new java.awt.Color(0, 0, 0));
        GITLOGSOURCEMAPPERjTable.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                GITLOGSOURCEMAPPERjTableMouseClicked(evt);
            }
        });
        GITLOGTABELjScrollPane.setViewportView(GITLOGSOURCEMAPPERjTable);
        GITLOGSOURCEMAPPERjTable.getAccessibleContext().setAccessibleDescription("");

        GITLOGjPanel.add(GITLOGTABELjScrollPane, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 170, 530, 110));

        GITLOGADDjButton.setText("新增");
        GITLOGADDjButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                GITLOGADDjButtonActionPerformed(evt);
            }
        });
        GITLOGjPanel.add(GITLOGADDjButton, new org.netbeans.lib.awtextra.AbsoluteConstraints(540, 170, -1, 20));

        GITLOGDELjButton.setText("删除");
        GITLOGDELjButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                GITLOGDELjButtonActionPerformed(evt);
            }
        });
        GITLOGjPanel.add(GITLOGDELjButton, new org.netbeans.lib.awtextra.AbsoluteConstraints(540, 200, -1, 20));

        GITLOGSAVECONFIGjButton.setText("保存");
        GITLOGSAVECONFIGjButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                GITLOGSAVECONFIGjButtonActionPerformed(evt);
            }
        });
        GITLOGjPanel.add(GITLOGSAVECONFIGjButton, new org.netbeans.lib.awtextra.AbsoluteConstraints(540, 230, -1, 20));

        GITLOGOUTPACKjButton.setText("打包");
        GITLOGOUTPACKjButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                GITLOGOUTPACKjButtonActionPerformed(evt);
            }
        });
        GITLOGjPanel.add(GITLOGOUTPACKjButton, new org.netbeans.lib.awtextra.AbsoluteConstraints(540, 260, -1, 20));

        GITLOGPROJECTCONFIGjButton.setText("配置");
        GITLOGPROJECTCONFIGjButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                GITLOGPROJECTCONFIGjButtonActionPerformed(evt);
            }
        });
        GITLOGjPanel.add(GITLOGPROJECTCONFIGjButton, new org.netbeans.lib.awtextra.AbsoluteConstraints(540, 20, -1, 20));

        GITLOGjScrollPane.setViewportView(GITLOGjPanel);

        PatchjTabbedPane.addTab("GIT日志增量", GITLOGjScrollPane);

        SVNLOGjScrollPane.setAutoscrolls(true);
        SVNLOGjScrollPane.setPreferredSize(new java.awt.Dimension(0, 0));

        SVNLOGjPanel.setAutoscrolls(true);
        SVNLOGjPanel.setPreferredSize(new java.awt.Dimension(0, 0));
        SVNLOGjPanel.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

        SVNLOGPATHjLabel.setText("SVN日志路径");
        SVNLOGjPanel.add(SVNLOGPATHjLabel, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 80, 90, 22));

        SVNLOGPATHjTextField.setFont(new java.awt.Font("幼圆", 0, 10)); // NOI18N
        SVNLOGjPanel.add(SVNLOGPATHjTextField, new org.netbeans.lib.awtextra.AbsoluteConstraints(110, 80, 420, 20));

        SVNLOGPROJECTjLabel.setText("项目路径");
        SVNLOGjPanel.add(SVNLOGPROJECTjLabel, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 50, -1, 20));

        SVNLOGPROJECTPATHjTextField.setFont(new java.awt.Font("幼圆", 0, 10)); // NOI18N
        SVNLOGjPanel.add(SVNLOGPROJECTPATHjTextField, new org.netbeans.lib.awtextra.AbsoluteConstraints(110, 50, 420, 20));

        SVNLOGPROJECTNAMEjLabel.setText("项目名称");
        SVNLOGjPanel.add(SVNLOGPROJECTNAMEjLabel, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 20, 50, 20));

        SVNLOGPROJECTNAMEjTextField.setFont(new java.awt.Font("幼圆", 0, 10)); // NOI18N
        SVNLOGjPanel.add(SVNLOGPROJECTNAMEjTextField, new org.netbeans.lib.awtextra.AbsoluteConstraints(110, 20, 420, 20));

        SVNLOGOUTPUTjLabel.setText("输出目录");
        SVNLOGjPanel.add(SVNLOGOUTPUTjLabel, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 110, 50, 22));

        SVNLOGOUTPUTjTextField.setFont(new java.awt.Font("幼圆", 0, 10)); // NOI18N
        SVNLOGjPanel.add(SVNLOGOUTPUTjTextField, new org.netbeans.lib.awtextra.AbsoluteConstraints(110, 110, 420, 20));

        SVNLOGPROJECTjButton.setText("浏览");
        SVNLOGPROJECTjButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                SVNLOGPROJECTjButtonActionPerformed(evt);
            }
        });
        SVNLOGjPanel.add(SVNLOGPROJECTjButton, new org.netbeans.lib.awtextra.AbsoluteConstraints(540, 50, -1, 20));

        SVNLOGPATHjButton.setText("浏览");
        SVNLOGPATHjButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                SVNLOGPATHjButtonActionPerformed(evt);
            }
        });
        SVNLOGjPanel.add(SVNLOGPATHjButton, new org.netbeans.lib.awtextra.AbsoluteConstraints(540, 80, -1, 20));

        SVNLOGOUTPUTjButton.setText("浏览");
        SVNLOGOUTPUTjButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                SVNLOGOUTPUTjButtonActionPerformed(evt);
            }
        });
        SVNLOGjPanel.add(SVNLOGOUTPUTjButton, new org.netbeans.lib.awtextra.AbsoluteConstraints(540, 110, -1, 20));

        SVNLOGOUTPACKjButton.setText("打包");
        SVNLOGOUTPACKjButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                SVNLOGOUTPACKjButtonActionPerformed(evt);
            }
        });
        SVNLOGjPanel.add(SVNLOGOUTPACKjButton, new org.netbeans.lib.awtextra.AbsoluteConstraints(540, 260, -1, 20));

        SVNLOGSOURCEMAPPERjTable.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {"/src/main/java", "target/classes", "/WEB-INF/classes"},
                {"/src/main/resources", "target/classes", "/WEB-INF/classes"},
                {"/src/main/webapp", "src/main/webapp", null}
            },
            new String [] {
                "sourceDir", "targetDir", "patchDir"
            }
        ) {
            Class[] types = new Class [] {
                java.lang.String.class, java.lang.String.class, java.lang.String.class
            };

            public Class getColumnClass(int columnIndex) {
                return types [columnIndex];
            }
        });
        SVNLOGSOURCEMAPPERjTable.setDoubleBuffered(true);
        SVNLOGSOURCEMAPPERjTable.setSelectionBackground(new java.awt.Color(204, 255, 204));
        SVNLOGSOURCEMAPPERjTable.setSelectionForeground(new java.awt.Color(0, 0, 0));
        SVNLOGSOURCEMAPPERjTable.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                SVNLOGSOURCEMAPPERjTableMouseClicked(evt);
            }
        });
        SVNLOGTABELjScrollPane.setViewportView(SVNLOGSOURCEMAPPERjTable);

        SVNLOGjPanel.add(SVNLOGTABELjScrollPane, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 170, 530, 110));

        SVNLOGADDjButton.setText("新增");
        SVNLOGADDjButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                SVNLOGADDjButtonActionPerformed(evt);
            }
        });
        SVNLOGjPanel.add(SVNLOGADDjButton, new org.netbeans.lib.awtextra.AbsoluteConstraints(540, 170, -1, 20));

        SVNLOGDELjButton.setText("删除");
        SVNLOGDELjButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                SVNLOGDELjButtonActionPerformed(evt);
            }
        });
        SVNLOGjPanel.add(SVNLOGDELjButton, new org.netbeans.lib.awtextra.AbsoluteConstraints(540, 200, -1, 20));

        SVNLOGPROJECTTYPEbuttonGroup.add(SVNLOGPROJECTSINGLEjRadioButton);
        SVNLOGPROJECTSINGLEjRadioButton.setSelected(true);
        SVNLOGPROJECTSINGLEjRadioButton.setText("单模块");
        SVNLOGjPanel.add(SVNLOGPROJECTSINGLEjRadioButton, new org.netbeans.lib.awtextra.AbsoluteConstraints(110, 140, 70, -1));

        SVNLOGPROJECTTYPEjLabel.setText("项目类型");
        SVNLOGjPanel.add(SVNLOGPROJECTTYPEjLabel, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 140, -1, 20));

        SVNLOGPROJECTTYPEbuttonGroup.add(SVNLOGPROJECTMUTILjRadioButton);
        SVNLOGPROJECTMUTILjRadioButton.setText("多模块");
        SVNLOGjPanel.add(SVNLOGPROJECTMUTILjRadioButton, new org.netbeans.lib.awtextra.AbsoluteConstraints(190, 140, 70, -1));

        SVNLOGSAVECONFIGjButton.setText("保存");
        SVNLOGSAVECONFIGjButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                SVNLOGSAVECONFIGjButtonActionPerformed(evt);
            }
        });
        SVNLOGjPanel.add(SVNLOGSAVECONFIGjButton, new org.netbeans.lib.awtextra.AbsoluteConstraints(540, 230, -1, 20));

        SVNLOGPROJECTCONFIGjButton.setText("配置");
        SVNLOGPROJECTCONFIGjButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                SVNLOGPROJECTCONFIGjButtonActionPerformed(evt);
            }
        });
        SVNLOGjPanel.add(SVNLOGPROJECTCONFIGjButton, new org.netbeans.lib.awtextra.AbsoluteConstraints(540, 20, -1, 20));

        SVNLOGjScrollPane.setViewportView(SVNLOGjPanel);

        PatchjTabbedPane.addTab("SVN日志增量", null, SVNLOGjScrollPane, "");
        SVNLOGjScrollPane.getAccessibleContext().setAccessibleName("");
        SVNLOGjScrollPane.getAccessibleContext().setAccessibleDescription("");

        MVNjScrollPane.setAutoscrolls(true);
        MVNjScrollPane.setPreferredSize(new java.awt.Dimension(0, 0));

        MVNPOMANALYSISjPanel.setAutoscrolls(true);
        MVNPOMANALYSISjPanel.setPreferredSize(new java.awt.Dimension(0, 0));
        MVNPOMANALYSISjPanel.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

        MVNPOMNEWPATHjLabel.setText("POM_NEW路径");
        MVNPOMANALYSISjPanel.add(MVNPOMNEWPATHjLabel, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 80, 90, 22));

        MVNPOMNEWPATHjTextField.setFont(new java.awt.Font("幼圆", 0, 10)); // NOI18N
        MVNPOMANALYSISjPanel.add(MVNPOMNEWPATHjTextField, new org.netbeans.lib.awtextra.AbsoluteConstraints(110, 80, 420, 20));

        MVNPOMANALYSISNAMEPROJECTNAMEjLabel.setText("项目名称");
        MVNPOMANALYSISjPanel.add(MVNPOMANALYSISNAMEPROJECTNAMEjLabel, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 50, 50, 20));

        MVNPOMANALYSISNAMEPROJECTNAMEjTextField.setFont(new java.awt.Font("幼圆", 0, 10)); // NOI18N
        MVNPOMANALYSISjPanel.add(MVNPOMANALYSISNAMEPROJECTNAMEjTextField, new org.netbeans.lib.awtextra.AbsoluteConstraints(110, 50, 420, 20));

        MVNPOMANALYSISOUTPUTjLabel.setText("输出目录");
        MVNPOMANALYSISjPanel.add(MVNPOMANALYSISOUTPUTjLabel, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 140, 50, 22));

        MVNPOMANALYSISOUTPUTjTextField.setFont(new java.awt.Font("幼圆", 0, 10)); // NOI18N
        MVNPOMANALYSISjPanel.add(MVNPOMANALYSISOUTPUTjTextField, new org.netbeans.lib.awtextra.AbsoluteConstraints(110, 140, 420, 20));

        MVNPOMOLDPATHjButton.setText("浏览");
        MVNPOMOLDPATHjButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                MVNPOMOLDPATHjButtonActionPerformed(evt);
            }
        });
        MVNPOMANALYSISjPanel.add(MVNPOMOLDPATHjButton, new org.netbeans.lib.awtextra.AbsoluteConstraints(540, 110, -1, 20));

        MVNPOMANALYSISOUTPUTjButton.setText("浏览");
        MVNPOMANALYSISOUTPUTjButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                MVNPOMANALYSISOUTPUTjButtonActionPerformed(evt);
            }
        });
        MVNPOMANALYSISjPanel.add(MVNPOMANALYSISOUTPUTjButton, new org.netbeans.lib.awtextra.AbsoluteConstraints(540, 140, -1, 20));

        MVNPOMANALYSISOUTPACKjButton.setText("打包");
        MVNPOMANALYSISOUTPACKjButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                MVNPOMANALYSISOUTPACKjButtonActionPerformed(evt);
            }
        });
        MVNPOMANALYSISjPanel.add(MVNPOMANALYSISOUTPACKjButton, new org.netbeans.lib.awtextra.AbsoluteConstraints(540, 200, -1, 20));

        MVNPOMANALYSISbuttonGroup.add(MVNPOMCOMPLETEANALYSISjRadioButton);
        MVNPOMCOMPLETEANALYSISjRadioButton.setSelected(true);
        MVNPOMCOMPLETEANALYSISjRadioButton.setLabel("完全分析");
        MVNPOMANALYSISjPanel.add(MVNPOMCOMPLETEANALYSISjRadioButton, new org.netbeans.lib.awtextra.AbsoluteConstraints(110, 170, 80, -1));

        MVNPOMDEPENDLEVELjLabel.setText("依赖级别");
        MVNPOMANALYSISjPanel.add(MVNPOMDEPENDLEVELjLabel, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 200, 70, 20));
        MVNPOMDEPENDLEVELjLabel.getAccessibleContext().setAccessibleName("POM分析类型");

        MVNPOMANALYSISbuttonGroup.add(MVNPOMDIFFANALYSISjRadioButton);
        MVNPOMDIFFANALYSISjRadioButton.setText("差异分析");
        MVNPOMANALYSISjPanel.add(MVNPOMDIFFANALYSISjRadioButton, new org.netbeans.lib.awtextra.AbsoluteConstraints(190, 170, 80, -1));
        MVNPOMDIFFANALYSISjRadioButton.getAccessibleContext().setAccessibleName("完全分析");

        MVNPOMANALYSISCONFIGjButton.setText("保存");
        MVNPOMANALYSISCONFIGjButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                MVNPOMANALYSISCONFIGjButtonActionPerformed(evt);
            }
        });
        MVNPOMANALYSISjPanel.add(MVNPOMANALYSISCONFIGjButton, new org.netbeans.lib.awtextra.AbsoluteConstraints(540, 170, -1, 20));

        MVNPOMANALYSISCTCONFIGjButton.setText("配置");
        MVNPOMANALYSISCTCONFIGjButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                MVNPOMANALYSISCTCONFIGjButtonActionPerformed(evt);
            }
        });
        MVNPOMANALYSISjPanel.add(MVNPOMANALYSISCTCONFIGjButton, new org.netbeans.lib.awtextra.AbsoluteConstraints(540, 20, -1, 20));

        MVNPOMANALYSISNAMEjTextField.setFont(new java.awt.Font("幼圆", 0, 10)); // NOI18N
        MVNPOMANALYSISjPanel.add(MVNPOMANALYSISNAMEjTextField, new org.netbeans.lib.awtextra.AbsoluteConstraints(110, 20, 420, 20));

        MVNPOMANALYSISNAMEjLabel.setText("分析名称");
        MVNPOMANALYSISjPanel.add(MVNPOMANALYSISNAMEjLabel, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 20, 50, 20));

        MVNPOMOLDPATHjLabel.setText("POM_OLD路径");
        MVNPOMANALYSISjPanel.add(MVNPOMOLDPATHjLabel, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 110, 90, 20));

        MVNPOMOLDPATHjTextField.setFont(new java.awt.Font("幼圆", 0, 10)); // NOI18N
        MVNPOMANALYSISjPanel.add(MVNPOMOLDPATHjTextField, new org.netbeans.lib.awtextra.AbsoluteConstraints(110, 110, 420, 20));

        MVNPOMNEWPATHjButton.setText("浏览");
        MVNPOMNEWPATHjButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                MVNPOMNEWPATHjButtonActionPerformed(evt);
            }
        });
        MVNPOMANALYSISjPanel.add(MVNPOMNEWPATHjButton, new org.netbeans.lib.awtextra.AbsoluteConstraints(540, 80, -1, 20));

        MVNPOMANALYSISTYPEjLabel1.setText("分析类型");
        MVNPOMANALYSISjPanel.add(MVNPOMANALYSISTYPEjLabel1, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 170, 70, 20));

        MVNPOMDEPENDLEVELbuttonGroup.add(MVNPOMTESTjRadioButton);
        MVNPOMTESTjRadioButton.setText("test");
        MVNPOMANALYSISjPanel.add(MVNPOMTESTjRadioButton, new org.netbeans.lib.awtextra.AbsoluteConstraints(190, 200, 60, -1));

        MVNPOMDEPENDLEVELbuttonGroup.add(MVNPOMSYSTEMjRadioButton);
        MVNPOMSYSTEMjRadioButton.setText("system");
        MVNPOMSYSTEMjRadioButton.setEnabled(false);
        MVNPOMANALYSISjPanel.add(MVNPOMSYSTEMjRadioButton, new org.netbeans.lib.awtextra.AbsoluteConstraints(430, 200, 80, -1));

        MVNPOMDEPENDLEVELbuttonGroup.add(MVNPOMCOMPILEjRadioButton);
        MVNPOMCOMPILEjRadioButton.setSelected(true);
        MVNPOMCOMPILEjRadioButton.setText("compile");
        MVNPOMANALYSISjPanel.add(MVNPOMCOMPILEjRadioButton, new org.netbeans.lib.awtextra.AbsoluteConstraints(110, 200, 80, -1));

        MVNPOMDEPENDLEVELbuttonGroup.add(MVNPOMRUNTIMEjRadioButton);
        MVNPOMRUNTIMEjRadioButton.setText("runtime");
        MVNPOMANALYSISjPanel.add(MVNPOMRUNTIMEjRadioButton, new org.netbeans.lib.awtextra.AbsoluteConstraints(270, 200, 80, -1));

        MVNPOMDEPENDLEVELbuttonGroup.add(MVNPOMPROVIDEDjRadioButton);
        MVNPOMPROVIDEDjRadioButton.setText("provided");
        MVNPOMANALYSISjPanel.add(MVNPOMPROVIDEDjRadioButton, new org.netbeans.lib.awtextra.AbsoluteConstraints(350, 200, 80, -1));

        MVNjScrollPane.setViewportView(MVNPOMANALYSISjPanel);

        PatchjTabbedPane.addTab("POM依赖分析", null, MVNjScrollPane, "");

        getContentPane().add(PatchjTabbedPane, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 0, 620, 390));
        PatchjTabbedPane.getAccessibleContext().setAccessibleName("");
        PatchjTabbedPane.getAccessibleContext().setAccessibleDescription("");

        CONSOLEtextArea.setEditable(false);
        CONSOLEtextArea.setFont(new java.awt.Font("Dialog", 1, 10)); // NOI18N
        CONSOLEtextArea.setVisible(false);
        getContentPane().add(CONSOLEtextArea, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 590, 620, 50));

        CONSOLEjLabel.setFont(new java.awt.Font("宋体", 0, 10)); // NOI18N
        CONSOLEjLabel.setText("控制台");
        getContentPane().add(CONSOLEjLabel, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 390, -1, 20));

        globalConsolejTextPane.setDragEnabled(true);
        globalConsolejTextPane.setDropMode(javax.swing.DropMode.INSERT);
        globalConsolejScrollPane.setViewportView(globalConsolejTextPane);

        getContentPane().add(globalConsolejScrollPane, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 410, 620, 230));

        globalConsoleClearjButton.setText("清空");
        globalConsoleClearjButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                globalConsoleClearjButtonActionPerformed(evt);
            }
        });
        getContentPane().add(globalConsoleClearjButton, new org.netbeans.lib.awtextra.AbsoluteConstraints(540, 390, 60, 20));

        PROJECTADDRESSjLabel.setFont(new java.awt.Font("宋体", 0, 10)); // NOI18N
        PROJECTADDRESSjLabel.setText("gitee地址：https://gitee.com/hackempire/patch-generator-desk");
        PROJECTADDRESSjLabel.setAutoscrolls(true);
        PROJECTADDRESSjLabel.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
        getContentPane().add(PROJECTADDRESSjLabel, new org.netbeans.lib.awtextra.AbsoluteConstraints(60, 390, 300, 20));

        SOFTVERSIONjLabel.setFont(new java.awt.Font("宋体", 1, 10)); // NOI18N
        SOFTVERSIONjLabel.setForeground(new java.awt.Color(204, 102, 0));
        getContentPane().add(SOFTVERSIONjLabel, new org.netbeans.lib.awtextra.AbsoluteConstraints(380, 390, 130, 20));

        pack();
    }// </editor-fold>//GEN-END:initComponents
    /**
     * SVN日志增量映射表删除一行
     *
     * @param evt
     */
    private void SVNLOGDELjButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_SVNLOGDELjButtonActionPerformed
        ((DefaultTableModel) SVNLOGSOURCEMAPPERjTable.getModel()).removeRow(SVNLOGSOURCEMAPPERjTable.getSelectedRow());
    }//GEN-LAST:event_SVNLOGDELjButtonActionPerformed
    /**
     * SVN日志增量映射表增加一行
     *
     * @param evt
     */
    private void SVNLOGADDjButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_SVNLOGADDjButtonActionPerformed
        ((DefaultTableModel) SVNLOGSOURCEMAPPERjTable.getModel()).addRow(new String[]{"", "", ""});
    }//GEN-LAST:event_SVNLOGADDjButtonActionPerformed
    /**
     * SVN日志增量点击打包
     *
     * @param evt
     */
    private void SVNLOGOUTPACKjButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_SVNLOGOUTPACKjButtonActionPerformed
        String projectName = SVNLOGPROJECTNAMEjTextField.getText();
        String projectPath = SVNLOGPROJECTPATHjTextField.getText();
        String logPath = SVNLOGPATHjTextField.getText();
        String outputPath = SVNLOGOUTPUTjTextField.getText();

        List<SourceMapper> sourceMappers = new ArrayList<>();
        DefaultTableModel sourceMapperModel = (DefaultTableModel) SVNLOGSOURCEMAPPERjTable.getModel();
        int rowCount = sourceMapperModel.getRowCount();
        for (int i = 0; i < rowCount; i++) {
            String sourceDir = sourceMapperModel.getValueAt(i, 0) != null ? sourceMapperModel.getValueAt(i, 0).toString() : "";
            String targetDir = sourceMapperModel.getValueAt(i, 1) != null ? sourceMapperModel.getValueAt(i, 1).toString() : "";
            String patchDir = sourceMapperModel.getValueAt(i, 2) != null ? sourceMapperModel.getValueAt(i, 2).toString() : "";
            if (StringUtils.isNotBlank(sourceDir) && StringUtils.isNotBlank(targetDir)) {
                SourceMapper sourceMapper = new SourceMapper(sourceDir, targetDir, patchDir);
                sourceMappers.add(sourceMapper);
            }
        }
        ProjectTypeEnum projectType = ProjectTypeEnum.SINGLEMODULE;
        if (SVNLOGPROJECTMUTILjRadioButton.isSelected()) {
            projectType = ProjectTypeEnum.MULTIMODULE;
        }
        SvnProjectInfo projectInfo = new SvnProjectInfo();
        projectInfo.setProjectName(projectName);
        projectInfo.setProjectType(projectType);
        if (!projectPath.endsWith("/")) {
            projectPath = projectPath + "/";
        }
        projectInfo.setTargetBaseDir(projectPath);
        projectInfo.setVersionManagerTypeEnum(VersionManagerTypeEnum.SVN);
        projectInfo.setSourceMappers(sourceMappers);
        PatchInfo patchInfo = new PatchInfo();
        patchInfo.setGenType(GenTypeEnum.LOG);
        patchInfo.setPatchFileDir(outputPath);
        patchInfo.setPatchFile(logPath);
        GeneratePatchExecutor.execute((ProjectInfo) projectInfo, patchInfo);
        LOGGER.info("打包完成");
    }//GEN-LAST:event_SVNLOGOUTPACKjButtonActionPerformed
    /**
     * SVN日志增量-增量包输出目录选择
     *
     * @param evt
     */
    private void SVNLOGOUTPUTjButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_SVNLOGOUTPUTjButtonActionPerformed
        String oldPomPath = SVNLOGOUTPUTjTextField.getText();
        //设置只能选择目录
        doJfileChooseAction(JFileChooser.DIRECTORIES_ONLY, SVNLOGOUTPUTjTextField, oldPomPath, null);
    }//GEN-LAST:event_SVNLOGOUTPUTjButtonActionPerformed
    /**
     * SVN日志增量-服务器项目URL路径选择
     *
     * @param evt
     */
    private void SVNLOGPATHjButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_SVNLOGPATHjButtonActionPerformed
        String oldPomPath = SVNLOGPATHjTextField.getText();
        doJfileChooseAction(JFileChooser.FILES_ONLY, SVNLOGPATHjTextField, oldPomPath, null);
    }//GEN-LAST:event_SVNLOGPATHjButtonActionPerformed
    /**
     * SVN日志增量项目本地路径选择
     *
     * @param evt
     */
    private void SVNLOGPROJECTjButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_SVNLOGPROJECTjButtonActionPerformed
        String oldPomPath = SVNLOGPROJECTPATHjTextField.getText();
        doJfileChooseAction(JFileChooser.DIRECTORIES_ONLY, SVNLOGPROJECTPATHjTextField, oldPomPath, null);
    }//GEN-LAST:event_SVNLOGPROJECTjButtonActionPerformed

    private void SVNLOGSOURCEMAPPERjTableMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_SVNLOGSOURCEMAPPERjTableMouseClicked
        // TODO add your handling code here:
//        int selectedRow = SVNLOGSOURCEMAPPERjTable.getSelectedRow(); //获得选中行索引
//        if (selectedRow != -1) {
//            
//        }
    }//GEN-LAST:event_SVNLOGSOURCEMAPPERjTableMouseClicked
    /**
     * SVN日志增量配置保存
     *
     * @param evt
     */
    private void SVNLOGSAVECONFIGjButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_SVNLOGSAVECONFIGjButtonActionPerformed
        // TODO add your handling code here:
        String projectName = SVNLOGPROJECTNAMEjTextField.getText();
        String projectPath = SVNLOGPROJECTPATHjTextField.getText();
        String logPath = SVNLOGPATHjTextField.getText();
        String outputPath = SVNLOGOUTPUTjTextField.getText();

        List<SourceMapper> sourceMappers = new ArrayList<>();
        DefaultTableModel sourceMapperModel = (DefaultTableModel) SVNLOGSOURCEMAPPERjTable.getModel();
        int rowCount = sourceMapperModel.getRowCount();
        for (int i = 0; i < rowCount; i++) {
            String sourceDir = sourceMapperModel.getValueAt(i, 0) != null ? sourceMapperModel.getValueAt(i, 0).toString() : "";
            String targetDir = sourceMapperModel.getValueAt(i, 1) != null ? sourceMapperModel.getValueAt(i, 1).toString() : "";
            String patchDir = sourceMapperModel.getValueAt(i, 2) != null ? sourceMapperModel.getValueAt(i, 2).toString() : "";
            if (StringUtils.isNotBlank(sourceDir) && StringUtils.isNotBlank(targetDir)) {
                SourceMapper sourceMapper = new SourceMapper(sourceDir, targetDir, patchDir);
                sourceMappers.add(sourceMapper);
            }
        }
        ProjectTypeEnum projectType = ProjectTypeEnum.SINGLEMODULE;
        if (SVNLOGPROJECTMUTILjRadioButton.isSelected()) {
            projectType = ProjectTypeEnum.MULTIMODULE;
        }
        String oldConfig = svnLogProjectConfig;
        if (StringUtils.isNotBlank(svnLogProjectConfig)) {
            svnLogProjectConfig = doJfileChooseAction(JFileChooser.FILES_ONLY, null, svnLogProjectConfig, "xml");
        } else {
            svnLogProjectConfig = doJfileChooseAction(JFileChooser.FILES_ONLY, null, null, "xml");
        }
        if (svnLogProjectConfig != null) {
            try {
                //DocumentHelper提供了创建Document对象的方法 
                Document document = DocumentHelper.createDocument();
                //添加节点信息 
                Element rootElement = document.addElement("patch-config");
                //这里可以继续添加子节点，也可以指定内容 
                //rootElement.setText("这个是module标签的文本信息");
                Element projectNameElement = rootElement.addElement("project-name");
                projectNameElement.setText(projectName);
                Element projectPathElement = rootElement.addElement("project-path");
                projectPathElement.setText(projectPath);
                Element logPathElement = rootElement.addElement("log-path");
                logPathElement.setText(logPath);
                Element outputPathElement = rootElement.addElement("output-path");
                outputPathElement.setText(outputPath);
                Element projectTypeElement = rootElement.addElement("project-type");
                projectTypeElement.setText(projectType.name());
                Element genTypeTypeElement = rootElement.addElement("gen-type");
                genTypeTypeElement.setText(GenTypeEnum.LOG.name());
                Element versionManagerTypeElement = rootElement.addElement("version-manager-type");
                versionManagerTypeElement.setText(VersionManagerTypeEnum.SVN.name());
                if (sourceMappers.size() > 0) {
                    Element sourceMappersElement = rootElement.addElement("source-mappers");
                    for (SourceMapper sourceMapper : sourceMappers) {
                        Element sourceMapperElement = sourceMappersElement.addElement("source-mapper");
                        Element sourceDirElement = sourceMapperElement.addElement("source-dir");
                        sourceDirElement.setText(sourceMapper.getSourceDir());
                        Element targetDirElement = sourceMapperElement.addElement("target-dir");
                        targetDirElement.setText(sourceMapper.getTargetDir());
                        Element patchDirElement = sourceMapperElement.addElement("patch-dir");
                        patchDirElement.setText(sourceMapper.getPatchDir());
                    }
                }
                Writer fileWriter = new FileWriter(svnLogProjectConfig);
                //设置文件编码  
                OutputFormat xmlFormat = new OutputFormat();
                xmlFormat.setEncoding("UTF-8");
                // 设置换行 
                xmlFormat.setNewlines(true);
                // 生成缩进 
                xmlFormat.setIndent(true);
                // 使用4个空格进行缩进, 可以兼容文本编辑器 
                xmlFormat.setIndent("    ");
                //dom4j提供了专门写入文件的对象XMLWriter 
                XMLWriter xmlWriter = new XMLWriter(fileWriter, xmlFormat);
                xmlWriter.write(document);
                xmlWriter.flush();
                xmlWriter.close();
                LOGGER.info("SVN日志增量保存配置文件保存成功！路径：{}", svnLogProjectConfig);
            } catch (IOException e) {
                LOGGER.error("SVN日志增量保存配置文件异常", e);
            }
        }
        if (StringUtils.isBlank(svnLogProjectConfig)) {
            svnLogProjectConfig = oldConfig;
        }
    }//GEN-LAST:event_SVNLOGSAVECONFIGjButtonActionPerformed
    /**
     * GIT日志增量项目本地路径选择
     *
     * @param evt
     */
    private void GITLOGPROJECTjButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_GITLOGPROJECTjButtonActionPerformed
        // TODO add your handling code here:
        String oldPomPath = GITLOGPROJECTPATHjTextField.getText();
        doJfileChooseAction(JFileChooser.DIRECTORIES_ONLY, GITLOGPROJECTPATHjTextField, oldPomPath, null);
    }//GEN-LAST:event_GITLOGPROJECTjButtonActionPerformed
    /**
     * GIT日志增量-本地记录的日志文件
     *
     * @param evt
     */
    private void GITLOGPATHjButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_GITLOGPATHjButtonActionPerformed
        String oldPomPath = GITLOGPATHjTextField.getText();
        // 设置智能选择文件
        doJfileChooseAction(JFileChooser.FILES_ONLY, GITLOGPATHjTextField, oldPomPath, "txt");
    }//GEN-LAST:event_GITLOGPATHjButtonActionPerformed
    /**
     * GIT日志增量-增量包输出目录选择
     *
     * @param evt
     */
    private void GITLOGOUTPUTjButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_GITLOGOUTPUTjButtonActionPerformed
        String oldPomPath = GITLOGOUTPUTjTextField.getText();
        doJfileChooseAction(JFileChooser.DIRECTORIES_ONLY, GITLOGOUTPUTjTextField, oldPomPath, null);
    }//GEN-LAST:event_GITLOGOUTPUTjButtonActionPerformed
    private void GITLOGSOURCEMAPPERjTableMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_GITLOGSOURCEMAPPERjTableMouseClicked
        // TODO add your handling code here:
    }//GEN-LAST:event_GITLOGSOURCEMAPPERjTableMouseClicked
    /**
     * GIT日志增量-映射表添加一行
     *
     * @param evt
     */
    private void GITLOGADDjButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_GITLOGADDjButtonActionPerformed
        ((DefaultTableModel) GITLOGSOURCEMAPPERjTable.getModel()).addRow(new String[]{"", "", ""});
    }//GEN-LAST:event_GITLOGADDjButtonActionPerformed
    /**
     * GIT日志增量-映射表删除一行
     *
     * @param evt
     */
    private void GITLOGDELjButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_GITLOGDELjButtonActionPerformed
        // TODO add your handling code here:
        ((DefaultTableModel) GITLOGSOURCEMAPPERjTable.getModel()).removeRow(GITLOGSOURCEMAPPERjTable.getSelectedRow());
    }//GEN-LAST:event_GITLOGDELjButtonActionPerformed
    /**
     * GIT日志增量-保存配置
     *
     * @param evt
     */
    private void GITLOGSAVECONFIGjButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_GITLOGSAVECONFIGjButtonActionPerformed
        // TODO add your handling code here:
        String projectName = GITLOGPROJECTNAMEjTextField.getText();
        String projectPath = GITLOGPROJECTPATHjTextField.getText();
        String logPath = GITLOGPATHjTextField.getText();
        String outputPath = GITLOGOUTPUTjTextField.getText();

        List<SourceMapper> sourceMappers = new ArrayList<>();
        DefaultTableModel sourceMapperModel = (DefaultTableModel) GITLOGSOURCEMAPPERjTable.getModel();
        int rowCount = sourceMapperModel.getRowCount();
        for (int i = 0; i < rowCount; i++) {
            String sourceDir = sourceMapperModel.getValueAt(i, 0) != null ? sourceMapperModel.getValueAt(i, 0).toString() : "";
            String targetDir = sourceMapperModel.getValueAt(i, 1) != null ? sourceMapperModel.getValueAt(i, 1).toString() : "";
            String patchDir = sourceMapperModel.getValueAt(i, 2) != null ? sourceMapperModel.getValueAt(i, 2).toString() : "";
            if (StringUtils.isNotBlank(sourceDir) && StringUtils.isNotBlank(targetDir)) {
                SourceMapper sourceMapper = new SourceMapper(sourceDir, targetDir, patchDir);
                sourceMappers.add(sourceMapper);
            }
        }
        ProjectTypeEnum projectType = ProjectTypeEnum.SINGLEMODULE;
        if (GITLOGPROJECTMUTILjRadioButton.isSelected()) {
            projectType = ProjectTypeEnum.MULTIMODULE;
        }
        String oldConfig = gitLogProjectConfig;
        if (StringUtils.isNotBlank(gitLogProjectConfig)) {
            gitLogProjectConfig = doJfileChooseAction(JFileChooser.FILES_ONLY, null, gitLogProjectConfig, "xml");
        } else {
            gitLogProjectConfig = doJfileChooseAction(JFileChooser.FILES_ONLY, null, null, "xml");
        }
        if (gitLogProjectConfig != null) {
            try {
                //DocumentHelper提供了创建Document对象的方法 
                Document document = DocumentHelper.createDocument();
                //添加节点信息 
                Element rootElement = document.addElement("patch-config");
                //这里可以继续添加子节点，也可以指定内容 
                //rootElement.setText("这个是module标签的文本信息");
                Element projectNameElement = rootElement.addElement("project-name");
                projectNameElement.setText(projectName);
                Element projectPathElement = rootElement.addElement("project-path");
                projectPathElement.setText(projectPath);
                Element logPathElement = rootElement.addElement("log-path");
                logPathElement.setText(logPath);
                Element outputPathElement = rootElement.addElement("output-path");
                outputPathElement.setText(outputPath);
                Element projectTypeElement = rootElement.addElement("project-type");
                projectTypeElement.setText(projectType.name());
                Element genTypeTypeElement = rootElement.addElement("gen-type");
                genTypeTypeElement.setText(GenTypeEnum.LOG.name());
                Element versionManagerTypeElement = rootElement.addElement("version-manager-type");
                versionManagerTypeElement.setText(VersionManagerTypeEnum.GIT.name());
                if (sourceMappers.size() > 0) {
                    Element sourceMappersElement = rootElement.addElement("source-mappers");
                    for (SourceMapper sourceMapper : sourceMappers) {
                        Element sourceMapperElement = sourceMappersElement.addElement("source-mapper");
                        Element sourceDirElement = sourceMapperElement.addElement("source-dir");
                        sourceDirElement.setText(sourceMapper.getSourceDir());
                        Element targetDirElement = sourceMapperElement.addElement("target-dir");
                        targetDirElement.setText(sourceMapper.getTargetDir());
                        Element patchDirElement = sourceMapperElement.addElement("patch-dir");
                        patchDirElement.setText(sourceMapper.getPatchDir());
                    }
                }
                Writer fileWriter = new FileWriter(gitLogProjectConfig);
                //设置文件编码  
                OutputFormat xmlFormat = new OutputFormat();
                xmlFormat.setEncoding("UTF-8");
                // 设置换行 
                xmlFormat.setNewlines(true);
                // 生成缩进 
                xmlFormat.setIndent(true);
                // 使用4个空格进行缩进, 可以兼容文本编辑器 
                xmlFormat.setIndent("    ");
                //dom4j提供了专门写入文件的对象XMLWriter 
                XMLWriter xmlWriter = new XMLWriter(fileWriter, xmlFormat);
                xmlWriter.write(document);
                xmlWriter.flush();
                xmlWriter.close();
                LOGGER.info("GIT日志增量保存配置文件保存成功！路径：{}", gitLogProjectConfig);
            } catch (IOException e) {
                LOGGER.error("GIT日志增量保存配置文件异常", e);
            }
        }
        if (StringUtils.isBlank(gitLogProjectConfig)) {
            gitLogProjectConfig = oldConfig;
        }
    }//GEN-LAST:event_GITLOGSAVECONFIGjButtonActionPerformed
    /**
     * GIt日志增量-点击打增量包
     *
     * @param evt
     */
    private void GITLOGOUTPACKjButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_GITLOGOUTPACKjButtonActionPerformed
        String projectName = GITLOGPROJECTNAMEjTextField.getText();
        String projectPath = GITLOGPROJECTPATHjTextField.getText();
        String logPath = GITLOGPATHjTextField.getText();
        String outputPath = GITLOGOUTPUTjTextField.getText();

        List<SourceMapper> sourceMappers = new ArrayList<>();
        DefaultTableModel sourceMapperModel = (DefaultTableModel) GITLOGSOURCEMAPPERjTable.getModel();
        int rowCount = sourceMapperModel.getRowCount();
        for (int i = 0; i < rowCount; i++) {
            String sourceDir = sourceMapperModel.getValueAt(i, 0) != null ? sourceMapperModel.getValueAt(i, 0).toString() : "";
            String targetDir = sourceMapperModel.getValueAt(i, 1) != null ? sourceMapperModel.getValueAt(i, 1).toString() : "";
            String patchDir = sourceMapperModel.getValueAt(i, 2) != null ? sourceMapperModel.getValueAt(i, 2).toString() : "";
            if (StringUtils.isNotBlank(sourceDir) && StringUtils.isNotBlank(targetDir)) {
                SourceMapper sourceMapper = new SourceMapper(sourceDir, targetDir, patchDir);
                sourceMappers.add(sourceMapper);
            }
        }
        ProjectTypeEnum projectType = ProjectTypeEnum.SINGLEMODULE;
        if (GITLOGPROJECTMUTILjRadioButton.isSelected()) {
            projectType = ProjectTypeEnum.MULTIMODULE;
        }
        GitProjectInfo projectInfo = new GitProjectInfo();
        projectInfo.setProjectName(projectName);
        projectInfo.setProjectType(projectType);
        if (!projectPath.endsWith("/")) {
            projectPath = projectPath + "/";
        }
        projectInfo.setTargetBaseDir(projectPath);
        projectInfo.setVersionManagerTypeEnum(VersionManagerTypeEnum.GIT);
        projectInfo.setSourceMappers(sourceMappers);
        PatchInfo patchInfo = new PatchInfo();
        patchInfo.setGenType(GenTypeEnum.LOG);
        patchInfo.setPatchFileDir(outputPath);
        patchInfo.setPatchFile(logPath);
        GeneratePatchExecutor.execute((ProjectInfo) projectInfo, patchInfo);
        LOGGER.info("打包完成");
    }//GEN-LAST:event_GITLOGOUTPACKjButtonActionPerformed
    /**
     * 点击清空控制台的内容
     *
     * @param evt
     */
    private void globalConsoleClearjButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_globalConsoleClearjButtonActionPerformed
        globalConsolejTextPane.setText("");
    }//GEN-LAST:event_globalConsoleClearjButtonActionPerformed
    /**
     * GIT服务器增量项目目录路径选择
     *
     * @param evt
     */
    private void GITSERVERPROJECTjButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_GITSERVERPROJECTjButtonActionPerformed
        String oldPomPath = GITSERVERPROJECTPATHjTextField.getText();
        //设置只能选择目录
        doJfileChooseAction(JFileChooser.DIRECTORIES_ONLY, GITSERVERPROJECTPATHjTextField, oldPomPath, null);
    }//GEN-LAST:event_GITSERVERPROJECTjButtonActionPerformed
    /**
     * GIT服务器增量项目本地.git文件夹目录路径选择
     *
     * @param evt
     */
    private void GITSERVERPATHjButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_GITSERVERPATHjButtonActionPerformed
        String oldPomPath = GITSERVERPATHjTextField.getText();
        //设置只能选择目录
        doJfileChooseAction(JFileChooser.DIRECTORIES_ONLY, GITSERVERPATHjTextField, oldPomPath, null);
    }//GEN-LAST:event_GITSERVERPATHjButtonActionPerformed
    /**
     * GIT服务器增量输出目录选择
     *
     * @param evt
     */
    private void GITSERVEROUTPUTjButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_GITSERVEROUTPUTjButtonActionPerformed
        String oldPomPath = GITSERVEROUTPUTjTextField.getText();
        //设置只能选择目录
        doJfileChooseAction(JFileChooser.DIRECTORIES_ONLY, GITSERVEROUTPUTjTextField, oldPomPath, null);
    }//GEN-LAST:event_GITSERVEROUTPUTjButtonActionPerformed
    /**
     * GIT服务器增量映射表添加一空行
     *
     * @param evt
     */
    private void GITSERVERADDjButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_GITSERVERADDjButtonActionPerformed
        ((DefaultTableModel) GITSERVERSOURCEMAPPERjTable.getModel()).addRow(new String[]{"", "", ""});
    }//GEN-LAST:event_GITSERVERADDjButtonActionPerformed
    /**
     * GIT服务器增量删除一行
     *
     * @param evt
     */
    private void GITSERVERDELjButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_GITSERVERDELjButtonActionPerformed
        ((DefaultTableModel) GITSERVERSOURCEMAPPERjTable.getModel()).removeRow(GITSERVERSOURCEMAPPERjTable.getSelectedRow());
    }//GEN-LAST:event_GITSERVERDELjButtonActionPerformed
    /**
     * GIT服务器增量-保存配置文件
     *
     * @param evt
     */
    private void GITSERVERSAVECONFIGjButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_GITSERVERSAVECONFIGjButtonActionPerformed
        String projectName = GITSERVERPROJECTNAMEjTextField.getText();
        String projectPath = GITSERVERPROJECTPATHjTextField.getText();
        String logPath = GITSERVERPATHjTextField.getText();
        String outputPath = GITSERVEROUTPUTjTextField.getText();
        String startVersion = GITSERVERVERSIONSTARTjTextField.getText();
        String endVersion = GITSERVERVERSIONENDjTextField.getText();
        List<SourceMapper> sourceMappers = new ArrayList<>();
        DefaultTableModel sourceMapperModel = (DefaultTableModel) GITSERVERSOURCEMAPPERjTable.getModel();
        int rowCount = sourceMapperModel.getRowCount();
        for (int i = 0; i < rowCount; i++) {
            String sourceDir = sourceMapperModel.getValueAt(i, 0) != null ? sourceMapperModel.getValueAt(i, 0).toString() : "";
            String targetDir = sourceMapperModel.getValueAt(i, 1) != null ? sourceMapperModel.getValueAt(i, 1).toString() : "";
            String patchDir = sourceMapperModel.getValueAt(i, 2) != null ? sourceMapperModel.getValueAt(i, 2).toString() : "";
            if (StringUtils.isNotBlank(sourceDir) && StringUtils.isNotBlank(targetDir)) {
                SourceMapper sourceMapper = new SourceMapper(sourceDir, targetDir, patchDir);
                sourceMappers.add(sourceMapper);
            }
        }
        ProjectTypeEnum projectType = ProjectTypeEnum.SINGLEMODULE;
        if (GITSERVERPROJECTMUTILjRadioButton.isSelected()) {
            projectType = ProjectTypeEnum.MULTIMODULE;
        }
        String oldConfig = gitServerProjectConfig;
        if (StringUtils.isNotBlank(gitServerProjectConfig)) {
            gitServerProjectConfig = doJfileChooseAction(JFileChooser.FILES_ONLY, null, gitLogProjectConfig, "xml");
        } else {
            gitServerProjectConfig = doJfileChooseAction(JFileChooser.FILES_ONLY, null, null, "xml");
        }
        if (gitServerProjectConfig != null) {
            try {
                //DocumentHelper提供了创建Document对象的方法 
                Document document = DocumentHelper.createDocument();
                //添加节点信息 
                Element rootElement = document.addElement("patch-config");
                //这里可以继续添加子节点，也可以指定内容 
                //rootElement.setText("这个是module标签的文本信息");
                Element projectNameElement = rootElement.addElement("project-name");
                projectNameElement.setText(projectName);
                Element projectPathElement = rootElement.addElement("project-path");
                projectPathElement.setText(projectPath);
                Element logPathElement = rootElement.addElement("log-path");
                logPathElement.setText(logPath);
                Element outputPathElement = rootElement.addElement("output-path");
                outputPathElement.setText(outputPath);
                Element projectTypeElement = rootElement.addElement("project-type");
                projectTypeElement.setText(projectType.name());
                Element genTypeTypeElement = rootElement.addElement("gen-type");
                genTypeTypeElement.setText(GenTypeEnum.VERSION.name());
                Element versionManagerTypeElement = rootElement.addElement("version-manager-type");
                versionManagerTypeElement.setText(VersionManagerTypeEnum.GIT.name());
                Element startVersionElement = rootElement.addElement("start-version");
                startVersionElement.setText(startVersion);
                Element endVersionElement = rootElement.addElement("end-version");
                endVersionElement.setText(endVersion);
                if (sourceMappers.size() > 0) {
                    Element sourceMappersElement = rootElement.addElement("source-mappers");
                    for (SourceMapper sourceMapper : sourceMappers) {
                        Element sourceMapperElement = sourceMappersElement.addElement("source-mapper");
                        Element sourceDirElement = sourceMapperElement.addElement("source-dir");
                        sourceDirElement.setText(sourceMapper.getSourceDir());
                        Element targetDirElement = sourceMapperElement.addElement("target-dir");
                        targetDirElement.setText(sourceMapper.getTargetDir());
                        Element patchDirElement = sourceMapperElement.addElement("patch-dir");
                        patchDirElement.setText(sourceMapper.getPatchDir());
                    }
                }
                Writer fileWriter = new FileWriter(gitServerProjectConfig);
                //设置文件编码  
                OutputFormat xmlFormat = new OutputFormat();
                xmlFormat.setEncoding("UTF-8");
                // 设置换行 
                xmlFormat.setNewlines(true);
                // 生成缩进 
                xmlFormat.setIndent(true);
                // 使用4个空格进行缩进, 可以兼容文本编辑器 
                xmlFormat.setIndent("    ");
                //dom4j提供了专门写入文件的对象XMLWriter 
                XMLWriter xmlWriter = new XMLWriter(fileWriter, xmlFormat);
                xmlWriter.write(document);
                xmlWriter.flush();
                xmlWriter.close();
                LOGGER.info("GIT服务器增量保存配置文件保存成功！路径：{}", gitServerProjectConfig);
            } catch (IOException e) {
                LOGGER.error("GIT服务器增量保存配置文件异常", e);
            }
        }
        if (StringUtils.isBlank(gitServerProjectConfig)) {
            gitServerProjectConfig = oldConfig;
        }
    }//GEN-LAST:event_GITSERVERSAVECONFIGjButtonActionPerformed
    /**
     * GIT服务器增量点击打包按钮执行打包事件
     *
     * @param evt
     */
    private void GITSERVEROUTPACKjButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_GITSERVEROUTPACKjButtonActionPerformed
        String projectName = GITSERVERPROJECTNAMEjTextField.getText();
        String projectPath = GITSERVERPROJECTPATHjTextField.getText();
        String gitRepositoryUrl = GITSERVERPATHjTextField.getText();
        String outputPath = GITSERVEROUTPUTjTextField.getText();
        String startVersion = GITSERVERVERSIONSTARTjTextField.getText();
        String endVersion = GITSERVERVERSIONENDjTextField.getText();

        ProjectTypeEnum projectType = ProjectTypeEnum.SINGLEMODULE;
        if (GITSERVERPROJECTMUTILjRadioButton.isSelected()) {
            projectType = ProjectTypeEnum.MULTIMODULE;
        }
        
        List<SourceMapper> sourceMappers = new ArrayList<>();
        DefaultTableModel sourceMapperModel = (DefaultTableModel) GITSERVERSOURCEMAPPERjTable.getModel();
        int rowCount = sourceMapperModel.getRowCount();
        for (int i = 0; i < rowCount; i++) {
            String sourceDir = sourceMapperModel.getValueAt(i, 0) != null ? sourceMapperModel.getValueAt(i, 0).toString() : "";
            String targetDir = sourceMapperModel.getValueAt(i, 1) != null ? sourceMapperModel.getValueAt(i, 1).toString() : "";
            String patchDir = sourceMapperModel.getValueAt(i, 2) != null ? sourceMapperModel.getValueAt(i, 2).toString() : "";
            if (StringUtils.isNotBlank(sourceDir) && StringUtils.isNotBlank(targetDir)) {
                if(projectType.equals(ProjectTypeEnum.SINGLEMODULE)&&sourceDir.indexOf("/")==1){
                    sourceDir=sourceDir.substring(1);
                }
                SourceMapper sourceMapper = new SourceMapper(sourceDir, targetDir, patchDir);
                sourceMappers.add(sourceMapper);
            }
        }
       
        GitProjectInfo projectInfo = new GitProjectInfo();
        projectInfo.setProjectName(projectName);
        projectInfo.setProjectType(projectType);
        if (!projectPath.endsWith("/")) {
            projectPath = projectPath + "/";
        }
        projectInfo.setTargetBaseDir(projectPath);
        projectInfo.setGitRepositoryUrl(gitRepositoryUrl);
        projectInfo.setVersionManagerTypeEnum(VersionManagerTypeEnum.GIT);
        projectInfo.setSourceMappers(sourceMappers);
        PatchInfo patchInfo = new PatchInfo();
        patchInfo.setGenType(GenTypeEnum.VERSION);
        patchInfo.setPatchFileDir(outputPath);
        patchInfo.setStartVersion(startVersion);
        patchInfo.setEndVersion(endVersion);
        GeneratePatchExecutor.execute((ProjectInfo) projectInfo, patchInfo);
        LOGGER.info("打包完成");
    }//GEN-LAST:event_GITSERVEROUTPACKjButtonActionPerformed
    /**
     * SVN服务器增量-项目本地目录选择
     *
     * @param evt
     */
    private void SVNSERVERPROJECTjButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_SVNSERVERPROJECTjButtonActionPerformed
        // TODO add your handling code here:
        String oldPomPath = SVNSERVERPROJECTPATHjTextField.getText();
        doJfileChooseAction(JFileChooser.DIRECTORIES_ONLY, SVNSERVERPROJECTPATHjTextField, oldPomPath, null);
    }//GEN-LAST:event_SVNSERVERPROJECTjButtonActionPerformed
    /**
     * SVN服务器增量-增量包输出目录选择
     *
     * @param evt
     */
    private void SVNSERVEROUTPUTjButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_SVNSERVEROUTPUTjButtonActionPerformed
        String oldPomPath = SVNSERVEROUTPUTjTextField.getText();
        doJfileChooseAction(JFileChooser.DIRECTORIES_ONLY, SVNSERVEROUTPUTjTextField, oldPomPath, null);
    }//GEN-LAST:event_SVNSERVEROUTPUTjButtonActionPerformed
    private void SVNSERVERSOURCEMAPPERjTableMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_SVNSERVERSOURCEMAPPERjTableMouseClicked
        // TODO add your handling code here:
    }//GEN-LAST:event_SVNSERVERSOURCEMAPPERjTableMouseClicked
    /**
     * SVN服务器增量-映射表新增一行
     *
     * @param evt
     */
    private void SVNSERVERADDjButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_SVNSERVERADDjButtonActionPerformed
        ((DefaultTableModel) SVNSERVERSOURCEMAPPERjTable.getModel()).addRow(new String[]{"", "", ""});
    }//GEN-LAST:event_SVNSERVERADDjButtonActionPerformed
    /**
     * SVN服务器增量-映射表删除一行
     *
     * @param evt
     */
    private void SVNSERVERDELjButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_SVNSERVERDELjButtonActionPerformed
        ((DefaultTableModel) SVNSERVERSOURCEMAPPERjTable.getModel()).removeRow(SVNSERVERSOURCEMAPPERjTable.getSelectedRow());
    }//GEN-LAST:event_SVNSERVERDELjButtonActionPerformed
    /**
     * SVN服务器增量-配置文件保存
     *
     * @param evt
     */
    private void SVNSERVERSAVECONFIGjButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_SVNSERVERSAVECONFIGjButtonActionPerformed
        // TODO add your handling code here:
        String projectName = SVNSERVERPROJECTNAMEjTextField.getText();
        String projectPath = SVNSERVERPROJECTPATHjTextField.getText();
        String svnPath = SVNSERVERPATHjTextField.getText();
        String outputPath = SVNSERVEROUTPUTjTextField.getText();
        String startVersion = SVNSERVERVERSIONSTARTjTextField.getText();
        String endVersion = SVNSERVERVERSIONENDjTextField.getText();
        String excludeVersion = SVNSERVEREXCLUDEjTextField.getText();
        String acount = SVNSERVERACOUNTjTextField.getText();
        String pwd = new String(SVNSERVERPWDjPasswordField.getPassword());
        String reviseMapper = SVNSERVERREVISEjTextField.getText();

        List<SourceMapper> sourceMappers = new ArrayList<>();
        DefaultTableModel sourceMapperModel = (DefaultTableModel) SVNSERVERSOURCEMAPPERjTable.getModel();
        int rowCount = sourceMapperModel.getRowCount();
        for (int i = 0; i < rowCount; i++) {
            String sourceDir = sourceMapperModel.getValueAt(i, 0) != null ? sourceMapperModel.getValueAt(i, 0).toString() : "";
            String targetDir = sourceMapperModel.getValueAt(i, 1) != null ? sourceMapperModel.getValueAt(i, 1).toString() : "";
            String patchDir = sourceMapperModel.getValueAt(i, 2) != null ? sourceMapperModel.getValueAt(i, 2).toString() : "";
            if (StringUtils.isNotBlank(sourceDir) && StringUtils.isNotBlank(targetDir)) {
                SourceMapper sourceMapper = new SourceMapper(sourceDir, targetDir, patchDir);
                sourceMappers.add(sourceMapper);
            }
        }
        ProjectTypeEnum projectType = ProjectTypeEnum.SINGLEMODULE;
        if (SVNSERVERPROJECTMUTILjRadioButton.isSelected()) {
            projectType = ProjectTypeEnum.MULTIMODULE;
        }
        String oldConfig = svnServerProjectConfig;
        if (StringUtils.isNotBlank(svnServerProjectConfig)) {
            svnServerProjectConfig = doJfileChooseAction(JFileChooser.FILES_ONLY, null, svnServerProjectConfig, "xml");
        } else {
            svnServerProjectConfig = doJfileChooseAction(JFileChooser.FILES_ONLY, null, null, "xml");
        }
        if (svnServerProjectConfig != null) {
            try {
                //DocumentHelper提供了创建Document对象的方法 
                Document document = DocumentHelper.createDocument();
                //添加节点信息 
                Element rootElement = document.addElement("patch-config");
                //这里可以继续添加子节点，也可以指定内容 
                //rootElement.setText("这个是module标签的文本信息");
                Element projectNameElement = rootElement.addElement("project-name");
                projectNameElement.setText(projectName);
                Element projectPathElement = rootElement.addElement("project-path");
                projectPathElement.setText(projectPath);
                Element svnPathElement = rootElement.addElement("svn-url");
                svnPathElement.setText(svnPath);
                Element acountElement = rootElement.addElement("svn-acount");
                acountElement.setText(acount);
                Element pwdElement = rootElement.addElement("svn-pwd");
                pwdElement.setText(pwd);
                Element reviseMapperElement = rootElement.addElement("revise-mapper");
                reviseMapperElement.setText(reviseMapper);
                Element outputPathElement = rootElement.addElement("output-path");
                outputPathElement.setText(outputPath);
                Element projectTypeElement = rootElement.addElement("project-type");
                projectTypeElement.setText(projectType.name());
                Element genTypeTypeElement = rootElement.addElement("gen-type");
                genTypeTypeElement.setText(GenTypeEnum.VERSION.name());
                Element versionManagerTypeElement = rootElement.addElement("version-manager-type");
                versionManagerTypeElement.setText(VersionManagerTypeEnum.SVN.name());
                Element startVersionElement = rootElement.addElement("start-version");
                startVersionElement.setText(startVersion);
                Element endVersionElement = rootElement.addElement("end-version");
                endVersionElement.setText(endVersion);
                Element excludeVersionElement = rootElement.addElement("exclude-version");
                excludeVersionElement.setText(excludeVersion);
                if (sourceMappers.size() > 0) {
                    Element sourceMappersElement = rootElement.addElement("source-mappers");
                    for (SourceMapper sourceMapper : sourceMappers) {
                        Element sourceMapperElement = sourceMappersElement.addElement("source-mapper");
                        Element sourceDirElement = sourceMapperElement.addElement("source-dir");
                        sourceDirElement.setText(sourceMapper.getSourceDir());
                        Element targetDirElement = sourceMapperElement.addElement("target-dir");
                        targetDirElement.setText(sourceMapper.getTargetDir());
                        Element patchDirElement = sourceMapperElement.addElement("patch-dir");
                        patchDirElement.setText(sourceMapper.getPatchDir());
                    }
                }
                Writer fileWriter = new FileWriter(svnServerProjectConfig);
                //设置文件编码  
                OutputFormat xmlFormat = new OutputFormat();
                xmlFormat.setEncoding("UTF-8");
                // 设置换行 
                xmlFormat.setNewlines(true);
                // 生成缩进 
                xmlFormat.setIndent(true);
                // 使用4个空格进行缩进, 可以兼容文本编辑器 
                xmlFormat.setIndent("    ");
                //dom4j提供了专门写入文件的对象XMLWriter 
                XMLWriter xmlWriter = new XMLWriter(fileWriter, xmlFormat);
                xmlWriter.write(document);
                xmlWriter.flush();
                xmlWriter.close();
                LOGGER.info("SVN服务器增量保存配置文件保存成功！路径：{}", svnServerProjectConfig);
            } catch (IOException e) {
                LOGGER.error("SVN服务器增量保存配置文件异常", e);
            }
        }
        if (StringUtils.isBlank(svnServerProjectConfig)) {
            svnServerProjectConfig = oldConfig;
        }
    }//GEN-LAST:event_SVNSERVERSAVECONFIGjButtonActionPerformed
    /**
     * SVN服务器增量-点击增量打包
     *
     * @param evt
     */
    private void SVNSERVEROUTPACKjButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_SVNSERVEROUTPACKjButtonActionPerformed
        // TODO add your handling code here:
        String projectName = SVNSERVERPROJECTNAMEjTextField.getText();
        String projectPath = SVNSERVERPROJECTPATHjTextField.getText();
        String svnUrl = SVNSERVERPATHjTextField.getText();
        String outputPath = SVNSERVEROUTPUTjTextField.getText();
        String startVersion = SVNSERVERVERSIONSTARTjTextField.getText();
        String endVersion = SVNSERVERVERSIONENDjTextField.getText();
        String excludeVersion = SVNSERVEREXCLUDEjTextField.getText();
        String acount = SVNSERVERACOUNTjTextField.getText();
        String pwd = new String(SVNSERVERPWDjPasswordField.getPassword());
        String reviseMapper = SVNSERVERREVISEjTextField.getText();

        List<SourceMapper> sourceMappers = new ArrayList<>();
        DefaultTableModel sourceMapperModel = (DefaultTableModel) SVNSERVERSOURCEMAPPERjTable.getModel();
        int rowCount = sourceMapperModel.getRowCount();
        for (int i = 0; i < rowCount; i++) {
            String sourceDir = sourceMapperModel.getValueAt(i, 0) != null ? sourceMapperModel.getValueAt(i, 0).toString() : "";
            String targetDir = sourceMapperModel.getValueAt(i, 1) != null ? sourceMapperModel.getValueAt(i, 1).toString() : "";
            String patchDir = sourceMapperModel.getValueAt(i, 2) != null ? sourceMapperModel.getValueAt(i, 2).toString() : "";
            if (StringUtils.isNotBlank(sourceDir) && StringUtils.isNotBlank(targetDir)) {
                SourceMapper sourceMapper = new SourceMapper(sourceDir, targetDir, patchDir);
                sourceMappers.add(sourceMapper);
            }
        }
        ProjectTypeEnum projectType = ProjectTypeEnum.SINGLEMODULE;
        if (SVNSERVERPROJECTMUTILjRadioButton.isSelected()) {
            projectType = ProjectTypeEnum.MULTIMODULE;
        }
        SvnProjectInfo projectInfo = new SvnProjectInfo();
        projectInfo.setProjectName(projectName);
        projectInfo.setProjectType(projectType);
        if (!projectPath.endsWith("/")) {
            projectPath = projectPath + "/";
        }
        projectInfo.setTargetBaseDir(projectPath);
        projectInfo.setSvnUrl(svnUrl);
        projectInfo.setVersionManagerTypeEnum(VersionManagerTypeEnum.SVN);
        projectInfo.setSourceMappers(sourceMappers);
        if (StringUtils.isNotBlank(reviseMapper)) {
            String[] reviseArr = reviseMapper.split(":");
            if (reviseArr.length == 1) {
                projectInfo.setReviseMapper(new ProjectReviseMapper(reviseMapper, ""));
            } else {
                projectInfo.setReviseMapper(new ProjectReviseMapper(reviseArr[0], reviseArr[1]));
            }
        }
        projectInfo.setSvnUsername(acount);
        projectInfo.setSvnPassword(pwd);
        PatchInfo patchInfo = new PatchInfo();
        patchInfo.setGenType(GenTypeEnum.VERSION);
        patchInfo.setPatchFileDir(outputPath);
        patchInfo.setStartVersion(startVersion);
        patchInfo.setEndVersion(endVersion);
        List<String> excludeRevisions = new ArrayList<>();
        if (StringUtils.isNotBlank(excludeVersion)) {
            excludeRevisions = Arrays.asList(excludeVersion.split(","));
        }

        patchInfo.setExcludeRevisions(excludeRevisions);
        GeneratePatchExecutor.execute((ProjectInfo) projectInfo, patchInfo);
        LOGGER.info("打包完成");
    }//GEN-LAST:event_SVNSERVEROUTPACKjButtonActionPerformed

    private void GITSERVERPROJECTCONFIGjButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_GITSERVERPROJECTCONFIGjButtonActionPerformed
        String oldConfig = gitServerProjectConfig;
        if (StringUtils.isNotBlank(gitServerProjectConfig)) {
            gitServerProjectConfig = doJfileChooseAction(JFileChooser.FILES_ONLY, null, gitLogProjectConfig, "xml");
        } else {
            gitServerProjectConfig = doJfileChooseAction(JFileChooser.FILES_ONLY, null, null, "xml");
        }
        LOGGER.info(gitServerProjectConfig);
        if (StringUtils.isNotBlank(gitServerProjectConfig)) {
            Document document = DOMUtils.getXMLByFilePath(gitServerProjectConfig);
            Element root = document.getRootElement();
            String genType = DOMUtils.getTextTrim(root, "gen-type");
            String versionManagerType = DOMUtils.getTextTrim(root, "version-manager-type");
            if (GenTypeEnum.VERSION.name().equals(genType) && VersionManagerTypeEnum.GIT.name().equals(versionManagerType)) {
                String projectName = DOMUtils.getTextTrim(root, "project-name");
                GITSERVERPROJECTNAMEjTextField.setText(projectName);
                String projectPath = DOMUtils.getTextTrim(root, "project-path");
                GITSERVERPROJECTPATHjTextField.setText(projectPath);
                String logPath = DOMUtils.getTextTrim(root, "log-path");
                GITSERVERPATHjTextField.setText(logPath);
                String outputPath = DOMUtils.getTextTrim(root, "output-path");
                GITSERVEROUTPUTjTextField.setText(outputPath);
                String projectType = DOMUtils.getTextTrim(root, "project-type");
                if (ProjectTypeEnum.MULTIMODULE.name().equals(projectType)) {
                    GITSERVERPROJECTMUTILjRadioButton.setSelected(true);
                } else {
                    GITSERVERPROJECTSINGLEjRadioButton.setSelected(true);
                }
                String startVersion = DOMUtils.getTextTrim(root, "start-version");
                GITSERVERVERSIONSTARTjTextField.setText(startVersion);
                String endVersion = DOMUtils.getTextTrim(root, "end-version");
                GITSERVERVERSIONENDjTextField.setText(endVersion);

                ((DefaultTableModel) GITSERVERSOURCEMAPPERjTable.getModel()).setRowCount(0);
                Element sourceMappersElment = DOMUtils.getChildElement(root, "source-mappers");
                if (sourceMappersElment != null) {
                    List<Element> sourceMappers = DOMUtils.getChildElements(sourceMappersElment);
                    if (sourceMappers != null) {
                        for (int i = 0, j = sourceMappers.size(); i < j; i++) {
                            Element curr = sourceMappers.get(i);
                            String sourceDir = DOMUtils.getTextTrim(curr, "source-dir");
                            String targetDir = DOMUtils.getTextTrim(curr, "target-dir");
                            String patchDir = DOMUtils.getTextTrim(curr, "patch-dir");
                            ((DefaultTableModel) GITSERVERSOURCEMAPPERjTable.getModel()).addRow(new String[]{sourceDir, targetDir, patchDir});
                        }
                    }
                }
                LOGGER.info("配置文件类型文件导入成功！");
            } else {
                LOGGER.error("配置文件类型文件gen-type、version-manager-type与当前类型不匹配！");
            }
        }
        if (StringUtils.isBlank(gitServerProjectConfig)) {
            gitServerProjectConfig = oldConfig;
        }
    }//GEN-LAST:event_GITSERVERPROJECTCONFIGjButtonActionPerformed
    /**
     * SVN服务器增量-导入配置文件
     *
     * @param evt
     */
    private void SVNSERVERPROJECTCONFIGjButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_SVNSERVERPROJECTCONFIGjButtonActionPerformed
        String oldConfig = svnServerProjectConfig;
        if (StringUtils.isNotBlank(svnServerProjectConfig)) {
            svnServerProjectConfig = doJfileChooseAction(JFileChooser.FILES_ONLY, null, svnServerProjectConfig, "xml");
        } else {
            svnServerProjectConfig = doJfileChooseAction(JFileChooser.FILES_ONLY, null, null, "xml");
        }
        LOGGER.info(svnServerProjectConfig);
        if (StringUtils.isNotBlank(svnServerProjectConfig)) {
            Document document = DOMUtils.getXMLByFilePath(svnServerProjectConfig);
            Element root = document.getRootElement();
            String genType = DOMUtils.getTextTrim(root, "gen-type");
            String versionManagerType = DOMUtils.getTextTrim(root, "version-manager-type");
            if (GenTypeEnum.VERSION.name().equals(genType) && VersionManagerTypeEnum.SVN.name().equals(versionManagerType)) {
                String projectName = DOMUtils.getTextTrim(root, "project-name");
                SVNSERVERPROJECTNAMEjTextField.setText(projectName);
                String projectPath = DOMUtils.getTextTrim(root, "project-path");
                SVNSERVERPROJECTPATHjTextField.setText(projectPath);
                String svnPath = DOMUtils.getTextTrim(root, "svn-url");
                SVNSERVERPATHjTextField.setText(svnPath);
                String acount = DOMUtils.getTextTrim(root, "svn-acount");
                SVNSERVERACOUNTjTextField.setText(acount);
                String pwd = DOMUtils.getTextTrim(root, "svn-pwd");
                SVNSERVERPWDjPasswordField.setText(pwd);
                String excludeVersion = DOMUtils.getTextTrim(root, "exclude-version");
                SVNSERVEREXCLUDEjTextField.setText(excludeVersion);

                String outputPath = DOMUtils.getTextTrim(root, "output-path");
                SVNSERVEROUTPUTjTextField.setText(outputPath);
                String projectType = DOMUtils.getTextTrim(root, "project-type");
                if (ProjectTypeEnum.MULTIMODULE.name().equals(projectType)) {
                    SVNSERVERPROJECTMUTILjRadioButton.setSelected(true);
                } else {
                    SVNSERVERPROJECTSINGLEjRadioButton.setSelected(true);
                }
                String startVersion = DOMUtils.getTextTrim(root, "start-version");
                SVNSERVERVERSIONSTARTjTextField.setText(startVersion);
                String endVersion = DOMUtils.getTextTrim(root, "end-version");
                SVNSERVERVERSIONENDjTextField.setText(endVersion);
                String reviseMapper = DOMUtils.getTextTrim(root, "revise-mapper");
                SVNSERVERREVISEjTextField.setText(reviseMapper);
                ((DefaultTableModel) SVNSERVERSOURCEMAPPERjTable.getModel()).setRowCount(0);
                Element sourceMappersElment = DOMUtils.getChildElement(root, "source-mappers");
                if (sourceMappersElment != null) {
                    List<Element> sourceMappers = DOMUtils.getChildElements(sourceMappersElment);
                    if (sourceMappers != null) {
                        for (int i = 0, j = sourceMappers.size(); i < j; i++) {
                            Element curr = sourceMappers.get(i);
                            String sourceDir = DOMUtils.getTextTrim(curr, "source-dir");
                            String targetDir = DOMUtils.getTextTrim(curr, "target-dir");
                            String patchDir = DOMUtils.getTextTrim(curr, "patch-dir");
                            ((DefaultTableModel) SVNSERVERSOURCEMAPPERjTable.getModel()).addRow(new String[]{sourceDir, targetDir, patchDir});
                        }
                    }
                }
                LOGGER.info("配置文件类型文件导入成功！");
            } else {
                LOGGER.error("配置文件类型文件gen-type、version-manager-type与当前类型不匹配！");
            }

        }
        if (StringUtils.isBlank(svnServerProjectConfig)) {
            svnServerProjectConfig = oldConfig;
        }
    }//GEN-LAST:event_SVNSERVERPROJECTCONFIGjButtonActionPerformed
    /**
     * git日志增量-导入配置文件
     *
     * @param evt
     */
    private void GITLOGPROJECTCONFIGjButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_GITLOGPROJECTCONFIGjButtonActionPerformed
        String oldConfig = gitLogProjectConfig;
        if (StringUtils.isNotBlank(gitLogProjectConfig)) {
            gitLogProjectConfig = doJfileChooseAction(JFileChooser.FILES_ONLY, null, gitLogProjectConfig, "xml");
        } else {
            gitLogProjectConfig = doJfileChooseAction(JFileChooser.FILES_ONLY, null, null, "xml");
        }
        LOGGER.info(gitLogProjectConfig);
        if (StringUtils.isNotBlank(gitLogProjectConfig)) {
            Document document = DOMUtils.getXMLByFilePath(gitLogProjectConfig);
            Element root = document.getRootElement();
            String genType = DOMUtils.getTextTrim(root, "gen-type");
            String versionManagerType = DOMUtils.getTextTrim(root, "version-manager-type");
            if (GenTypeEnum.LOG.name().equals(genType) && VersionManagerTypeEnum.GIT.name().equals(versionManagerType)) {
                String projectName = DOMUtils.getTextTrim(root, "project-name");
                GITLOGPROJECTNAMEjTextField.setText(projectName);
                String projectPath = DOMUtils.getTextTrim(root, "project-path");
                GITLOGPROJECTPATHjTextField.setText(projectPath);
                String logPath = DOMUtils.getTextTrim(root, "log-path");
                GITLOGPATHjTextField.setText(logPath);
                String outputPath = DOMUtils.getTextTrim(root, "output-path");
                GITLOGOUTPUTjTextField.setText(outputPath);
                String projectType = DOMUtils.getTextTrim(root, "project-type");
                if (ProjectTypeEnum.MULTIMODULE.name().equals(projectType)) {
                    GITLOGPROJECTMUTILjRadioButton.setSelected(true);
                } else {
                    GITLOGPROJECTSINGLEjRadioButton.setSelected(true);
                }
                ((DefaultTableModel) GITLOGSOURCEMAPPERjTable.getModel()).setRowCount(0);
                Element sourceMappersElment = DOMUtils.getChildElement(root, "source-mappers");
                if (sourceMappersElment != null) {
                    List<Element> sourceMappers = DOMUtils.getChildElements(sourceMappersElment);
                    if (sourceMappers != null) {
                        for (int i = 0, j = sourceMappers.size(); i < j; i++) {
                            Element curr = sourceMappers.get(i);
                            String sourceDir = DOMUtils.getTextTrim(curr, "source-dir");
                            String targetDir = DOMUtils.getTextTrim(curr, "target-dir");
                            String patchDir = DOMUtils.getTextTrim(curr, "patch-dir");
                            ((DefaultTableModel) GITLOGSOURCEMAPPERjTable.getModel()).addRow(new String[]{sourceDir, targetDir, patchDir});
                        }
                    }
                }
                LOGGER.info("配置文件类型文件导入成功！");
            } else {
                LOGGER.error("配置文件类型文件gen-type、version-manager-type与当前类型不匹配！");
            }
        }
        if (StringUtils.isBlank(gitLogProjectConfig)) {
            gitLogProjectConfig = oldConfig;
        }
    }//GEN-LAST:event_GITLOGPROJECTCONFIGjButtonActionPerformed
    /**
     * SVN日志增量-导入配置文件
     *
     * @param evt
     */
    private void SVNLOGPROJECTCONFIGjButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_SVNLOGPROJECTCONFIGjButtonActionPerformed
        String oldConfig = svnLogProjectConfig;
        if (StringUtils.isNotBlank(svnLogProjectConfig)) {
            svnLogProjectConfig = doJfileChooseAction(JFileChooser.FILES_ONLY, null, svnLogProjectConfig, "xml");
        } else {
            svnLogProjectConfig = doJfileChooseAction(JFileChooser.FILES_ONLY, null, null, "xml");
        }
        LOGGER.info(svnLogProjectConfig);
        if (StringUtils.isNotBlank(svnLogProjectConfig)) {
            Document document = DOMUtils.getXMLByFilePath(svnLogProjectConfig);
            Element root = document.getRootElement();
            String genType = DOMUtils.getTextTrim(root, "gen-type");
            String versionManagerType = DOMUtils.getTextTrim(root, "version-manager-type");
            if (GenTypeEnum.LOG.name().equals(genType) && VersionManagerTypeEnum.SVN.name().equals(versionManagerType)) {
                String projectName = DOMUtils.getTextTrim(root, "project-name");
                SVNLOGPROJECTNAMEjTextField.setText(projectName);
                String projectPath = DOMUtils.getTextTrim(root, "project-path");
                SVNLOGPROJECTPATHjTextField.setText(projectPath);
                String logPath = DOMUtils.getTextTrim(root, "log-path");
                SVNLOGPATHjTextField.setText(logPath);
                String outputPath = DOMUtils.getTextTrim(root, "output-path");
                SVNLOGOUTPUTjTextField.setText(outputPath);
                String projectType = DOMUtils.getTextTrim(root, "project-type");
                if (ProjectTypeEnum.MULTIMODULE.name().equals(projectType)) {
                    SVNLOGPROJECTMUTILjRadioButton.setSelected(true);
                } else {
                    SVNLOGPROJECTSINGLEjRadioButton.setSelected(true);
                }
                ((DefaultTableModel) SVNLOGSOURCEMAPPERjTable.getModel()).setRowCount(0);
                Element sourceMappersElment = DOMUtils.getChildElement(root, "source-mappers");
                if (sourceMappersElment != null) {
                    List<Element> sourceMappers = DOMUtils.getChildElements(sourceMappersElment);
                    if (sourceMappers != null) {
                        for (int i = 0, j = sourceMappers.size(); i < j; i++) {
                            Element curr = sourceMappers.get(i);
                            String sourceDir = DOMUtils.getTextTrim(curr, "source-dir");
                            String targetDir = DOMUtils.getTextTrim(curr, "target-dir");
                            String patchDir = DOMUtils.getTextTrim(curr, "patch-dir");
                            ((DefaultTableModel) SVNLOGSOURCEMAPPERjTable.getModel()).addRow(new String[]{sourceDir, targetDir, patchDir});
                        }
                    }
                }
                LOGGER.info("配置文件类型文件导入成功！");
            } else {
                LOGGER.error("配置文件类型文件gen-type、version-manager-type与当前类型不匹配！");
            }

        }
        if (StringUtils.isBlank(svnLogProjectConfig)) {
            svnLogProjectConfig = oldConfig;
        }
    }//GEN-LAST:event_SVNLOGPROJECTCONFIGjButtonActionPerformed
    /**
     * 选择MVN POM分析输出目录
     *
     * @param evt
     */
    private void MVNPOMANALYSISOUTPUTjButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_MVNPOMANALYSISOUTPUTjButtonActionPerformed
        String mvnPomAnalysisOutput = MVNPOMANALYSISOUTPUTjTextField.getText();
        doJfileChooseAction(JFileChooser.DIRECTORIES_ONLY, MVNPOMANALYSISOUTPUTjTextField, mvnPomAnalysisOutput, null);
    }//GEN-LAST:event_MVNPOMANALYSISOUTPUTjButtonActionPerformed
    /**
     * MVN pom依赖分析打包
     *
     * @param evt
     */
    private void MVNPOMANALYSISOUTPACKjButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_MVNPOMANALYSISOUTPACKjButtonActionPerformed
        String analysisName = MVNPOMANALYSISNAMEjTextField.getText();
        String projectName = MVNPOMANALYSISNAMEPROJECTNAMEjTextField.getText();
        String pomNewPath = MVNPOMNEWPATHjTextField.getText();
        String pomOldPath = MVNPOMOLDPATHjTextField.getText();
        String outputPath = MVNPOMANALYSISOUTPUTjTextField.getText();
        if (StringUtils.isBlank(analysisName)) {
            LOGGER.error("分析名称为空");
            return;
        }
        if (StringUtils.isBlank(projectName)) {
            LOGGER.error("项目名称为空");
            return;
        }
        if (StringUtils.isBlank(pomNewPath)) {
            LOGGER.error("POM_NEW路径为空");
            return;
        }
        if (StringUtils.isBlank(pomOldPath)) {
            LOGGER.error("POM_OLD路径为空");
            return;
        }
        if (StringUtils.isBlank(outputPath)) {
            LOGGER.warn("输出路径为空,依赖分析包将放在打包工具所在目录");
        }
        AnalysisTypeEnum analysisType = AnalysisTypeEnum.COMPLETEANALYSISMODULE;
        if (MVNPOMDIFFANALYSISjRadioButton.isSelected()) {
            analysisType = AnalysisTypeEnum.DIFFANALYSISMODULE;
        }
        DependLevelEnum dependLevelEnum = DependLevelEnum.COMPILE;
        if (MVNPOMCOMPILEjRadioButton.isSelected()) {
            dependLevelEnum = DependLevelEnum.COMPILE;
        } else if (MVNPOMTESTjRadioButton.isSelected()) {
            dependLevelEnum = DependLevelEnum.TEST;
        } else if (MVNPOMRUNTIMEjRadioButton.isSelected()) {
            dependLevelEnum = DependLevelEnum.RUNTIME;
        } else if (MVNPOMPROVIDEDjRadioButton.isSelected()) {
            dependLevelEnum = DependLevelEnum.PROVIDED;
        } else {
            dependLevelEnum = DependLevelEnum.SYSTEM;
        }
        String dependLevel = dependLevelEnum.name().toLowerCase();
        //mvntest.bat D:\\SpringRooWorkSpace\\ump20170420_chery_pc E:\\apache-maven-3.5.3\\conf\\settings.xml E:\\mvntest\\lib
        String userDir = System.getProperty("user.dir");
        LOGGER.info("开始执行maven pom bat命令!工作目录：" + userDir);
        String dateFormatStr = DateUtil.formatDateStr(DateUtil.SHORT_SECOND);
        String FILE_SEPARATOR = System.getProperty("file.separator");
        if (StringUtils.isBlank(outputPath)) {
            outputPath = userDir;
        }
        LOGGER.info("请稍等片刻...");
        outputPath = outputPath + FILE_SEPARATOR + projectName + FILE_SEPARATOR + analysisName + FILE_SEPARATOR + dateFormatStr + FILE_SEPARATOR + "pomlib";
        String newOutputPath = outputPath + FILE_SEPARATOR + "new";
        String oldOutputPath = outputPath + FILE_SEPARATOR + "old";
        String diffOutputPath = outputPath + FILE_SEPARATOR + "diff";
        final AnalysisTypeEnum analysisTypeClone = analysisType;
        CyclicBarrier cyclicBarrier = new CyclicBarrier(2, new Runnable() {
            @Override
            public void run() {
                if (AnalysisTypeEnum.DIFFANALYSISMODULE.name().equals(analysisTypeClone.name())) {
                    LOGGER.info("POM依赖差异分析线程：" + Thread.currentThread().getName() + " is running...");
                    doMavenPomAnalysisDiffAction(newOutputPath, oldOutputPath, diffOutputPath, FILE_SEPARATOR);
                    LOGGER.info("POM依赖差异分析线程：" + Thread.currentThread().getName() + " is terminated.");
                }

            }
        });
        LOGGER.info("maven analysis doing.............");
        //path.replace("/", FILE_SEPARATOR).replace("\\", FILE_SEPARATOR);
        //分析new pom
        executor.execute(new Runnable() {
            @Override
            public void run() {
                try {
                    LOGGER.info("new pom分析线程：" + Thread.currentThread().getName() + " is running...");
                    doMavenPomAnalysisAction(newOutputPath, pomNewPath, dependLevel, userDir);
                    LOGGER.info("new pom分析线程：" + Thread.currentThread().getName() + " is terminated.");
                    cyclicBarrier.await();

                } catch (InterruptedException | BrokenBarrierException e) {
                    LOGGER.error("new pom分析时出现错误", e);
                }
            }
        });
        //分析old pom
        executor.execute(new Runnable() {
            @Override
            public void run() {
                try {
                    LOGGER.info("old pom分析线程：" + Thread.currentThread().getName() + " is running...");
                    doMavenPomAnalysisAction(oldOutputPath, pomOldPath, dependLevel, userDir);
                    LOGGER.info("old pom分析线程：" + Thread.currentThread().getName() + " is terminated.");
                    cyclicBarrier.await();
                } catch (InterruptedException | BrokenBarrierException e) {
                    LOGGER.error("old pom分析时出现错误", e);
                }

            }
        });
    }//GEN-LAST:event_MVNPOMANALYSISOUTPACKjButtonActionPerformed
    /**
     * MVN POM分析配置文件保存
     *
     * @param evt
     */
    private void MVNPOMANALYSISCONFIGjButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_MVNPOMANALYSISCONFIGjButtonActionPerformed
        String analysisName = MVNPOMANALYSISNAMEjTextField.getText();
        String projectName = MVNPOMANALYSISNAMEPROJECTNAMEjTextField.getText();
        String pomNewPath = MVNPOMNEWPATHjTextField.getText();
        String pomOldPath = MVNPOMOLDPATHjTextField.getText();
        String outputPath = MVNPOMANALYSISOUTPUTjTextField.getText();
        AnalysisTypeEnum analysisType = AnalysisTypeEnum.COMPLETEANALYSISMODULE;
        if (MVNPOMDIFFANALYSISjRadioButton.isSelected()) {
            analysisType = AnalysisTypeEnum.DIFFANALYSISMODULE;
        }
        DependLevelEnum dependLevelEnum = DependLevelEnum.COMPILE;
        if (MVNPOMCOMPILEjRadioButton.isSelected()) {
            dependLevelEnum = DependLevelEnum.COMPILE;
        } else if (MVNPOMTESTjRadioButton.isSelected()) {
            dependLevelEnum = DependLevelEnum.TEST;
        } else if (MVNPOMRUNTIMEjRadioButton.isSelected()) {
            dependLevelEnum = DependLevelEnum.RUNTIME;
        } else if (MVNPOMPROVIDEDjRadioButton.isSelected()) {
            dependLevelEnum = DependLevelEnum.PROVIDED;
        } else {
            dependLevelEnum = DependLevelEnum.SYSTEM;
        }
        String oldConfig = MvnPomAnalysisProjectConfig;
        if (StringUtils.isNotBlank(MvnPomAnalysisProjectConfig)) {
            MvnPomAnalysisProjectConfig = doJfileChooseAction(JFileChooser.FILES_ONLY, null, MvnPomAnalysisProjectConfig, "xml");
        } else {
            MvnPomAnalysisProjectConfig = doJfileChooseAction(JFileChooser.FILES_ONLY, null, null, "xml");
        }
        LOGGER.info(MvnPomAnalysisProjectConfig);
        if (MvnPomAnalysisProjectConfig != null) {
            XMLWriter xmlWriter = null;
            OutputStreamWriter out = null;
            BufferedWriter fileWriter = null;
            try {
                //DocumentHelper提供了创建Document对象的方法 
                Document document = DocumentHelper.createDocument();
                //添加节点信息 
                Element rootElement = document.addElement("patch-config");
                //这里可以继续添加子节点，也可以指定内容 
                //rootElement.setText("这个是module标签的文本信息");
                Element analysisNameElement = rootElement.addElement("analysis-name");
                analysisNameElement.setText(analysisName);
                Element projectNameElement = rootElement.addElement("project-name");
                projectNameElement.setText(projectName);
                Element pomNewPathElement = rootElement.addElement("pom-new-path");
                pomNewPathElement.setText(pomNewPath);
                Element pomOldPathElement = rootElement.addElement("pom-old-path");
                pomOldPathElement.setText(pomOldPath);
                Element outputPathElement = rootElement.addElement("output-path");
                outputPathElement.setText(outputPath);
                Element analysisTypeElement = rootElement.addElement("analysis-type");
                analysisTypeElement.setText(analysisType.name());
                Element dependLevelElement = rootElement.addElement("depend-level");
                dependLevelElement.setText(dependLevelEnum.name());
                //Writer fileWriter = new FileWriter(MvnPomAnalysisProjectConfig);
                out = new OutputStreamWriter(new FileOutputStream(MvnPomAnalysisProjectConfig), "UTF-8");
                fileWriter = new BufferedWriter(out);
                //设置文件编码  
                OutputFormat xmlFormat = new OutputFormat();
                xmlFormat.setEncoding("UTF-8");
                // 设置换行 
                xmlFormat.setNewlines(true);
                // 生成缩进 
                xmlFormat.setIndent(true);
                // 使用4个空格进行缩进, 可以兼容文本编辑器 
                xmlFormat.setIndent("    ");
                //dom4j提供了专门写入文件的对象XMLWriter 
                xmlWriter = new XMLWriter(fileWriter, xmlFormat);
                xmlWriter.write(document);
                xmlWriter.flush();
                LOGGER.info("MVN POM ANALYSIS保存配置文件保存成功！路径：{}", MvnPomAnalysisProjectConfig);
            } catch (IOException e) {
                LOGGER.error("MVN POM ANALYSIS保存配置文件异常", e);
            } finally {
                if (xmlWriter != null) {
                    try {
                        xmlWriter.close();
                    } catch (IOException ex) {
                        LOGGER.error("MVN POM ANALYSIS保存配置文件关闭流异常", ex);
                    }
                }
                if (fileWriter != null) {
                    try {
                        fileWriter.close();
                    } catch (IOException ex) {
                        LOGGER.error("MVN POM ANALYSIS保存配置文件关闭流异常", ex);
                    }
                }
                if (out != null) {
                    try {
                        out.close();
                    } catch (IOException ex) {
                        LOGGER.error("MVN POM ANALYSIS保存配置文件关闭流异常", ex);
                    }
                }
            }
        }
        if (StringUtils.isBlank(MvnPomAnalysisProjectConfig)) {
            MvnPomAnalysisProjectConfig = oldConfig;
        }
    }//GEN-LAST:event_MVNPOMANALYSISCONFIGjButtonActionPerformed
    /**
     * 导入Maven pom依赖分析配置文件
     *
     * @param evt
     */
    private void MVNPOMANALYSISCTCONFIGjButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_MVNPOMANALYSISCTCONFIGjButtonActionPerformed
        // TODO add your handling code here:
        String oldConfig = MvnPomAnalysisProjectConfig;
        if (StringUtils.isNotBlank(MvnPomAnalysisProjectConfig)) {
            MvnPomAnalysisProjectConfig = doJfileChooseAction(JFileChooser.FILES_ONLY, null, MvnPomAnalysisProjectConfig, "xml");
        } else {
            MvnPomAnalysisProjectConfig = doJfileChooseAction(JFileChooser.FILES_ONLY, null, null, "xml");
        }

        LOGGER.info(MvnPomAnalysisProjectConfig);
        if (StringUtils.isNotBlank(MvnPomAnalysisProjectConfig)) {
            Document document = DOMUtils.getXMLByFilePath(MvnPomAnalysisProjectConfig);
            Element root = document.getRootElement();
            String analysisType = DOMUtils.getTextTrim(root, "analysis-type");
            if (AnalysisTypeEnum.COMPLETEANALYSISMODULE.name().equals(analysisType) || AnalysisTypeEnum.DIFFANALYSISMODULE.name().equals(analysisType)) {
                String analysisName = DOMUtils.getTextTrim(root, "analysis-name");
                String projectName = DOMUtils.getTextTrim(root, "project-name");
                String pomNewPath = DOMUtils.getTextTrim(root, "pom-new-path");
                String pomOldPath = DOMUtils.getTextTrim(root, "pom-old-path");
                String outputPath = DOMUtils.getTextTrim(root, "output-path");
                String dependLevel = DOMUtils.getTextTrim(root, "depend-level");
                MVNPOMANALYSISNAMEjTextField.setText(analysisName);
                MVNPOMANALYSISNAMEPROJECTNAMEjTextField.setText(projectName);
                MVNPOMNEWPATHjTextField.setText(pomNewPath);
                MVNPOMOLDPATHjTextField.setText(pomOldPath);
                MVNPOMANALYSISOUTPUTjTextField.setText(outputPath);
                if (AnalysisTypeEnum.DIFFANALYSISMODULE.name().equals(analysisType)) {
                    MVNPOMDIFFANALYSISjRadioButton.setSelected(true);
                } else {
                    MVNPOMCOMPLETEANALYSISjRadioButton.setSelected(true);
                }
                if (DependLevelEnum.COMPILE.name().equals(dependLevel)) {
                    MVNPOMCOMPILEjRadioButton.setSelected(true);
                } else if (DependLevelEnum.TEST.name().equals(dependLevel)) {
                    MVNPOMTESTjRadioButton.setSelected(true);
                } else if (DependLevelEnum.RUNTIME.name().equals(dependLevel)) {
                    MVNPOMRUNTIMEjRadioButton.setSelected(true);
                } else if (DependLevelEnum.PROVIDED.name().equals(dependLevel)) {
                    MVNPOMPROVIDEDjRadioButton.setSelected(true);
                } else {
                    MVNPOMSYSTEMjRadioButton.setSelected(true);
                }
                LOGGER.info("配置文件类型文件导入成功！");
            } else {
                LOGGER.error("配置文件类型文件analysis-type与当前类型不匹配！");
            }
        }
        if (StringUtils.isBlank(MvnPomAnalysisProjectConfig)) {
            MvnPomAnalysisProjectConfig = oldConfig;
        }
    }//GEN-LAST:event_MVNPOMANALYSISCTCONFIGjButtonActionPerformed
    /**
     * 选择pom.xml老路径
     *
     * @param evt
     */
    private void MVNPOMOLDPATHjButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_MVNPOMOLDPATHjButtonActionPerformed
        // TODO add your handling code here:
        String oldPomPath = MVNPOMOLDPATHjTextField.getText();
        doJfileChooseAction(JFileChooser.FILES_ONLY, MVNPOMOLDPATHjTextField, oldPomPath, "xml");
    }//GEN-LAST:event_MVNPOMOLDPATHjButtonActionPerformed
    /**
     * 选择pom.xml新路径
     *
     * @param evt
     */
    private void MVNPOMNEWPATHjButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_MVNPOMNEWPATHjButtonActionPerformed
        // TODO add your handling code here:
        String newPomPath = MVNPOMNEWPATHjTextField.getText();
        doJfileChooseAction(JFileChooser.FILES_ONLY, MVNPOMNEWPATHjTextField, newPomPath, "xml");
    }//GEN-LAST:event_MVNPOMNEWPATHjButtonActionPerformed

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /* Set the Nimbus look and feel */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException | InstantiationException | IllegalAccessException | javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(GeneratorMainJFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>
        /* Create and display the form */
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                 String softVersion="";
                try {
                    String html=HttpUtil.get("https://gitee.com/hackempire/patch-generator-desk/attach_files");
                    String softPre="patch-generator-desk-";
                    int index=html.indexOf(softPre);
                    if(index!=-1){
                        softVersion=html.substring(index+softPre.length(),index+softPre.length()+6);
                    }
                } catch (Exception ex) {
                    java.util.logging.Logger.getLogger(GeneratorMainJFrame.class.getName()).log(Level.SEVERE, null, ex);
                }
                JFrame mainJFrame = new GeneratorMainJFrame();
                (((GeneratorMainJFrame) mainJFrame).SOFTVERSIONjLabel).setText("最新版本："+softVersion);
                MainFrameConsoleUtil.initConsole(((GeneratorMainJFrame) mainJFrame).CONSOLEtextArea, ((GeneratorMainJFrame) mainJFrame).globalConsolejTextPane);
                Dimension screen = Toolkit.getDefaultToolkit().getScreenSize();
                //设置软件图标
                URL url = GeneratorMainJFrame.class.getResource("/patch_desk.png");
                ImageIcon icon = new ImageIcon(url);
                //mainJFrame.setIconImage(Toolkit.getDefaultToolkit().getImage("patch_desk.png"));
                mainJFrame.setIconImage(icon.getImage());
                mainJFrame.setLocation((screen.width - mainJFrame.getSize().width) / 2, (screen.height - mainJFrame.getSize().height) / 2);//使启动窗口居中显示
                mainJFrame.setVisible(true);
            }
        });
    }

    /**
     * @param jFileChooserType FILES_ONLY = 0| DIRECTORIES_ONLY =
     * 1|FILES_AND_DIRECTORIES = 2
     * @param jTextField
     */
    private String doJfileChooseAction(int jFileChooserType, javax.swing.JTextField jTextField, String configPath, String fileSuffix) {
        globaljFileChooser.setFileSelectionMode(jFileChooserType);//只能选择目录
        globaljFileChooser.resetChoosableFileFilters();
//        globaljFileChooser.setDialogType(JFileChooser.SAVE_DIALOG);
       //globaljFileChooser.showDialog(new JLabel(), "选择");
        globaljFileChooser.setApproveButtonText("保存");
        globaljFileChooser.setDialogTitle("选择");
        if (StringUtils.isNotBlank(fileSuffix)) {
            globaljFileChooser.setFileFilter(new FileSuffixFilter(fileSuffix));
        }
        if (StringUtils.isNotBlank(configPath)) {
            File confPath = new File(configPath);
            if (confPath.isDirectory()) {
                globaljFileChooser.setCurrentDirectory(confPath);
            } else if (confPath.isFile()) {
                globaljFileChooser.setSelectedFile(confPath);
            }
        } else {
            globaljFileChooser.setSelectedFile(null);
        }
//int i = globaljFileChooser.showDialog(new JLabel("选择"), "保存");
        //int i = globaljFileChooser.showOpenDialog(null);
        int i = globaljFileChooser.showSaveDialog(this);
       
        String path = null;
        if (i == JFileChooser.APPROVE_OPTION) { //打开文件
            path = globaljFileChooser.getSelectedFile().getAbsolutePath();
            String name = globaljFileChooser.getSelectedFile().getName();
            LOGGER.info("当前文件路径：" + path + ";当前文件名：" + name);
            if (jTextField != null) {
                jTextField.setText(path);
            }
        } else {
            LOGGER.info("没有选中文件");
        }
        return path;
    }

    JFileChooser globaljFileChooser = new javax.swing.JFileChooser();
    private static final Logger LOGGER = LoggerFactory.getLogger(GeneratorMainJFrame.class);
    private String svnLogProjectConfig = null;
    private String svnServerProjectConfig = null;
    private String gitLogProjectConfig = null;
    private String gitServerProjectConfig = null;
    private String MvnPomAnalysisProjectConfig = null;
    private ExecutorService executor = Executors.newFixedThreadPool(Runtime.getRuntime().availableProcessors());


    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JLabel CONSOLEjLabel;
    private java.awt.TextArea CONSOLEtextArea;
    private javax.swing.JButton GITLOGADDjButton;
    private javax.swing.JButton GITLOGDELjButton;
    private javax.swing.JButton GITLOGOUTPACKjButton;
    private javax.swing.JButton GITLOGOUTPUTjButton;
    private javax.swing.JLabel GITLOGOUTPUTjLabel;
    private javax.swing.JTextField GITLOGOUTPUTjTextField;
    private javax.swing.JButton GITLOGPATHjButton;
    private javax.swing.JLabel GITLOGPATHjLabel;
    private javax.swing.JTextField GITLOGPATHjTextField;
    private javax.swing.JButton GITLOGPROJECTCONFIGjButton;
    private javax.swing.JRadioButton GITLOGPROJECTMUTILjRadioButton;
    private javax.swing.JLabel GITLOGPROJECTNAMEjLabel;
    private javax.swing.JTextField GITLOGPROJECTNAMEjTextField;
    private javax.swing.JTextField GITLOGPROJECTPATHjTextField;
    private javax.swing.JRadioButton GITLOGPROJECTSINGLEjRadioButton;
    private javax.swing.ButtonGroup GITLOGPROJECTTYPEbuttonGroup;
    private javax.swing.JLabel GITLOGPROJECTTYPEjLabel;
    private javax.swing.JButton GITLOGPROJECTjButton;
    private javax.swing.JLabel GITLOGPROJECTjLabel;
    private javax.swing.JButton GITLOGSAVECONFIGjButton;
    private javax.swing.JTable GITLOGSOURCEMAPPERjTable;
    private javax.swing.JScrollPane GITLOGTABELjScrollPane;
    private javax.swing.JPanel GITLOGjPanel;
    private javax.swing.JScrollPane GITLOGjScrollPane;
    private javax.swing.JButton GITSERVERADDjButton;
    private javax.swing.JButton GITSERVERDELjButton;
    private javax.swing.JButton GITSERVEROUTPACKjButton;
    private javax.swing.JButton GITSERVEROUTPUTjButton;
    private javax.swing.JLabel GITSERVEROUTPUTjLabel;
    private javax.swing.JTextField GITSERVEROUTPUTjTextField;
    private javax.swing.JButton GITSERVERPATHjButton;
    private javax.swing.JLabel GITSERVERPATHjLabel;
    private javax.swing.JTextField GITSERVERPATHjTextField;
    private javax.swing.JButton GITSERVERPROJECTCONFIGjButton;
    private javax.swing.JRadioButton GITSERVERPROJECTMUTILjRadioButton;
    private javax.swing.JLabel GITSERVERPROJECTNAMEjLabel;
    private javax.swing.JTextField GITSERVERPROJECTNAMEjTextField;
    private javax.swing.JTextField GITSERVERPROJECTPATHjTextField;
    private javax.swing.JRadioButton GITSERVERPROJECTSINGLEjRadioButton;
    private javax.swing.ButtonGroup GITSERVERPROJECTTYPEbuttonGroup;
    private javax.swing.JLabel GITSERVERPROJECTTYPEjLabel;
    private javax.swing.JButton GITSERVERPROJECTjButton;
    private javax.swing.JLabel GITSERVERPROJECTjLabel;
    private javax.swing.JButton GITSERVERSAVECONFIGjButton;
    private javax.swing.JTable GITSERVERSOURCEMAPPERjTable;
    private javax.swing.JScrollPane GITSERVERTABELjScrollPane;
    private javax.swing.JLabel GITSERVERVERSIONCENTERjLabel;
    private javax.swing.JTextField GITSERVERVERSIONENDjTextField;
    private javax.swing.JTextField GITSERVERVERSIONSTARTjTextField;
    private javax.swing.JLabel GITSERVERVERSIONjLabel;
    private javax.swing.JPanel GITSERVERjPanel;
    private javax.swing.JScrollPane GITSERVERjScrollPane;
    private javax.swing.JButton MVNPOMANALYSISCONFIGjButton;
    private javax.swing.JButton MVNPOMANALYSISCTCONFIGjButton;
    private javax.swing.JLabel MVNPOMANALYSISNAMEPROJECTNAMEjLabel;
    private javax.swing.JTextField MVNPOMANALYSISNAMEPROJECTNAMEjTextField;
    private javax.swing.JLabel MVNPOMANALYSISNAMEjLabel;
    private javax.swing.JTextField MVNPOMANALYSISNAMEjTextField;
    private javax.swing.JButton MVNPOMANALYSISOUTPACKjButton;
    private javax.swing.JButton MVNPOMANALYSISOUTPUTjButton;
    private javax.swing.JLabel MVNPOMANALYSISOUTPUTjLabel;
    private javax.swing.JTextField MVNPOMANALYSISOUTPUTjTextField;
    private javax.swing.JLabel MVNPOMANALYSISTYPEjLabel1;
    private javax.swing.ButtonGroup MVNPOMANALYSISbuttonGroup;
    private javax.swing.JPanel MVNPOMANALYSISjPanel;
    private javax.swing.JRadioButton MVNPOMCOMPILEjRadioButton;
    private javax.swing.JRadioButton MVNPOMCOMPLETEANALYSISjRadioButton;
    private javax.swing.ButtonGroup MVNPOMDEPENDLEVELbuttonGroup;
    private javax.swing.JLabel MVNPOMDEPENDLEVELjLabel;
    private javax.swing.JRadioButton MVNPOMDIFFANALYSISjRadioButton;
    private javax.swing.JButton MVNPOMNEWPATHjButton;
    private javax.swing.JLabel MVNPOMNEWPATHjLabel;
    private javax.swing.JTextField MVNPOMNEWPATHjTextField;
    private javax.swing.JButton MVNPOMOLDPATHjButton;
    private javax.swing.JLabel MVNPOMOLDPATHjLabel;
    private javax.swing.JTextField MVNPOMOLDPATHjTextField;
    private javax.swing.JRadioButton MVNPOMPROVIDEDjRadioButton;
    private javax.swing.JRadioButton MVNPOMRUNTIMEjRadioButton;
    private javax.swing.JRadioButton MVNPOMSYSTEMjRadioButton;
    private javax.swing.JRadioButton MVNPOMTESTjRadioButton;
    private javax.swing.JScrollPane MVNjScrollPane;
    private javax.swing.JLabel PROJECTADDRESSjLabel;
    private javax.swing.JTabbedPane PatchjTabbedPane;
    private javax.swing.JLabel SOFTVERSIONjLabel;
    private javax.swing.JButton SVNLOGADDjButton;
    private javax.swing.JButton SVNLOGDELjButton;
    private javax.swing.JButton SVNLOGOUTPACKjButton;
    private javax.swing.JButton SVNLOGOUTPUTjButton;
    private javax.swing.JLabel SVNLOGOUTPUTjLabel;
    private javax.swing.JTextField SVNLOGOUTPUTjTextField;
    private javax.swing.JButton SVNLOGPATHjButton;
    private javax.swing.JLabel SVNLOGPATHjLabel;
    private javax.swing.JTextField SVNLOGPATHjTextField;
    private javax.swing.JButton SVNLOGPROJECTCONFIGjButton;
    private javax.swing.JRadioButton SVNLOGPROJECTMUTILjRadioButton;
    private javax.swing.JLabel SVNLOGPROJECTNAMEjLabel;
    private javax.swing.JTextField SVNLOGPROJECTNAMEjTextField;
    private javax.swing.JTextField SVNLOGPROJECTPATHjTextField;
    private javax.swing.JRadioButton SVNLOGPROJECTSINGLEjRadioButton;
    private javax.swing.ButtonGroup SVNLOGPROJECTTYPEbuttonGroup;
    private javax.swing.JLabel SVNLOGPROJECTTYPEjLabel;
    private javax.swing.JButton SVNLOGPROJECTjButton;
    private javax.swing.JLabel SVNLOGPROJECTjLabel;
    private javax.swing.JButton SVNLOGSAVECONFIGjButton;
    private javax.swing.JTable SVNLOGSOURCEMAPPERjTable;
    private javax.swing.JScrollPane SVNLOGTABELjScrollPane;
    private javax.swing.JPanel SVNLOGjPanel;
    private javax.swing.JScrollPane SVNLOGjScrollPane;
    private javax.swing.JLabel SVNSERVERACOUNTjLabel;
    private javax.swing.JTextField SVNSERVERACOUNTjTextField;
    private javax.swing.JButton SVNSERVERADDjButton;
    private javax.swing.JButton SVNSERVERDELjButton;
    private javax.swing.JLabel SVNSERVEREXCLUDEjLabel;
    private javax.swing.JTextField SVNSERVEREXCLUDEjTextField;
    private javax.swing.JButton SVNSERVEROUTPACKjButton;
    private javax.swing.JButton SVNSERVEROUTPUTjButton;
    private javax.swing.JLabel SVNSERVEROUTPUTjLabel;
    private javax.swing.JTextField SVNSERVEROUTPUTjTextField;
    private javax.swing.JLabel SVNSERVERPATHjLabel;
    private javax.swing.JTextField SVNSERVERPATHjTextField;
    private javax.swing.JButton SVNSERVERPROJECTCONFIGjButton;
    private javax.swing.JRadioButton SVNSERVERPROJECTMUTILjRadioButton;
    private javax.swing.JLabel SVNSERVERPROJECTNAMEjLabel;
    private javax.swing.JTextField SVNSERVERPROJECTNAMEjTextField;
    private javax.swing.JTextField SVNSERVERPROJECTPATHjTextField;
    private javax.swing.JRadioButton SVNSERVERPROJECTSINGLEjRadioButton;
    private javax.swing.ButtonGroup SVNSERVERPROJECTTYPEbuttonGroup;
    private javax.swing.JLabel SVNSERVERPROJECTTYPEjLabel;
    private javax.swing.JButton SVNSERVERPROJECTjButton;
    private javax.swing.JLabel SVNSERVERPROJECTjLabel;
    private javax.swing.JLabel SVNSERVERPWDjLabel;
    private javax.swing.JPasswordField SVNSERVERPWDjPasswordField;
    private javax.swing.JLabel SVNSERVERREVISEPATHjLabel;
    private javax.swing.JTextField SVNSERVERREVISEjTextField;
    private javax.swing.JButton SVNSERVERSAVECONFIGjButton;
    private javax.swing.JTable SVNSERVERSOURCEMAPPERjTable;
    private javax.swing.JScrollPane SVNSERVERTABELjScrollPane;
    private javax.swing.JLabel SVNSERVERVERSIONCENTERjLabel;
    private javax.swing.JTextField SVNSERVERVERSIONENDjTextField;
    private javax.swing.JTextField SVNSERVERVERSIONSTARTjTextField;
    private javax.swing.JLabel SVNSERVERVERSIONjLabel;
    private javax.swing.JPanel SVNSERVERjPanel;
    private javax.swing.JScrollPane SVNSERVERjScrollPane;
    private javax.swing.JButton globalConsoleClearjButton;
    private javax.swing.JScrollPane globalConsolejScrollPane;
    private javax.swing.JTextPane globalConsolejTextPane;
    // End of variables declaration//GEN-END:variables
    /**
     * maven pom analysis依赖包差异分析
     *
     * @param newOutputPath
     * @param oldOutputPath
     * @param diffOutputPath
     * @param fileSeparator
     */
    private void doMavenPomAnalysisDiffAction(String newOutputPath, String oldOutputPath, String diffOutputPath, String fileSeparator) {
        File diffOutputPathFile = new File(diffOutputPath);
        if (!diffOutputPathFile.exists()) {
            diffOutputPathFile.mkdirs();
        }
        File diffAddOutputPathFile = new File(diffOutputPath + fileSeparator + "add");
        File diffRemoveOutputPathFile = new File(diffOutputPath + fileSeparator + "remove");
        if (!diffAddOutputPathFile.exists()) {
            diffAddOutputPathFile.mkdirs();
        }
        if (!diffRemoveOutputPathFile.exists()) {
            diffRemoveOutputPathFile.mkdirs();
        }
        File newFsPath = new File(newOutputPath);
        File[] newFsArr = newFsPath.listFiles();
        ArrayList<String> newFsList = new ArrayList<String>();
        for (File f : newFsArr) {
            newFsList.add(f.getName());
        }
        File oldFsPath = new File(oldOutputPath);
        File[] oldFsArr = oldFsPath.listFiles();
        ArrayList<String> oldFsList = new ArrayList<String>();
        for (File f : oldFsArr) {
            oldFsList.add(f.getName());
        }
        // 集合相减  
        ArrayList<String> addSubtractList = (ArrayList<String>) CollectionUtils.subtract(newFsList, oldFsList);
        // 集合相减  
        ArrayList<String> minusSubtractList = (ArrayList<String>) CollectionUtils.subtract(oldFsList, newFsList);
        for (int i = 0; i < newFsArr.length; ++i) {
            if (addSubtractList.contains(newFsArr[i].getName())) {
                if (newFsArr[i].isFile()) {
                    final File newFsFile = newFsArr[i];
                    String name = newFsFile.getName();
                    final File newFile = new File(diffOutputPath + fileSeparator + "add" + fileSeparator + name);
                    if (!newFile.exists()) {
                        try {
                            System.out.println(newFile);
                            newFile.createNewFile();
                            executor.execute(new Runnable() {
                                @Override
                                public void run() {
                                    try {
                                        FileUtil.fileChannelCopy(newFsFile, newFile);
                                    } catch (IOException e) {
                                        LOGGER.error("MVN POM依赖差异分析打包流信息处理add异常", e);
                                    }
                                }
                            });

                        } catch (IOException e) {
                            LOGGER.error("MVN POM依赖差异分析打包流信息处理add异常", e);
                        }
                    }
                }
            }
        }
        for (int i = 0; i < oldFsArr.length; ++i) {
            if (minusSubtractList.contains(oldFsArr[i].getName())) {
                if (oldFsArr[i].isFile()) {
                    final File oldFsFile = oldFsArr[i];
                    String name = oldFsFile.getName();
                    final File newFile = new File(diffOutputPath + fileSeparator + "remove" + fileSeparator + name);
                    if (!newFile.exists()) {
                        try {
                            System.out.println(newFile);
                            newFile.createNewFile();
                            executor.execute(new Runnable() {
                                @Override
                                public void run() {
                                    try {
                                        FileUtil.fileChannelCopy(oldFsFile, newFile);
                                    } catch (IOException e) {
                                        LOGGER.error("MVN POM依赖差异分析打包流信息处理remove异常", e);
                                    }
                                }
                            });
                        } catch (IOException e) {
                            LOGGER.error("MVN POM依赖差异分析打包流信息处理remove异常", e);
                        }
                    }
                }
            }
        }

    }

    /**
     * maven pom analysis依赖包分析
     *
     * @param outputPath
     * @param pomPath
     * @param dependLevel
     * @param userDir
     */
    private void doMavenPomAnalysisAction(String outputPath, String pomPath, String dependLevel, String userDir) {
        Process child = null;
        InputStream in = null;
        try {
            child = child = Runtime.getRuntime().exec(
                    "cmd /c  start /b " + userDir + "\\mvn_analysis.bat  " + pomPath + "  " + outputPath + "  " + dependLevel);
            StreamGobblerHandle errorGobbler = new StreamGobblerHandle(child.getErrorStream(), "Error");
            StreamGobblerHandle outputGobbler = new StreamGobblerHandle(child.getInputStream(), "Output");
            List<Future> tasks = new ArrayList<Future>();
            tasks.add(executor.submit(errorGobbler));
            tasks.add(executor.submit(outputGobbler));
            for (Future task : tasks) {
                try {
                    if (task.get() != null) {
                    }
                } catch (InterruptedException | ExecutionException ex) {
                    LOGGER.error("MVN POM依赖分析打包流信息处理异常", ex);
                }
            }
            child.waitFor();
            int i = child.exitValue();
            if (i == 0) {
                LOGGER.info("执行maven pom bat命令完成!");
            } else {
                LOGGER.info("执行maven pom bat命令失败!");
            }
        } catch (IOException | InterruptedException ex) {
            LOGGER.error("MVN POM依赖分析打包异常", ex);
        } finally {
            if (child != null) {
                //child.destroy();  //销毁子进程
            }
            if (in != null) {
                try {
                    in.close();
                } catch (IOException ex) {
                    LOGGER.error("关闭文件流异常", ex);
                }
            }
        }
    }
}

class FileSuffixFilter extends FileFilter {

    private final static String DESCRIPTION = "FILESUFFIX";
    private String fileSuffix = "xml";

    public FileSuffixFilter() {
    }

    public FileSuffixFilter(String fileSuffix) {
        this.fileSuffix = fileSuffix;
    }

    @Override
    public boolean accept(File f) {
        //throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
        boolean result = true;
        if (!f.isDirectory()) {
            String fileName = f.getName();
            String suffix = fileName.substring(fileName.lastIndexOf(".") + 1);
            result = fileSuffix.equals(suffix);
        }
        return result;
    }

    @Override
    public String getDescription() {
        //throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
        return DESCRIPTION;
    }
};
